Repository :
http://git.fedorahosted.org/cgit/copr.git
On branch : master
---------------------------------------------------------------
commit 3681a555a2555ab36497e9da115eccc9e9f70c23
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Fri Oct 24 14:31:59 2014 +0200
[frontend] some fixes around auto_createrepo
---------------------------------------------------------------
frontend/coprs_frontend/coprs/forms.py | 2 +-
frontend/coprs_frontend/coprs/logic/coprs_logic.py | 5 +++--
.../coprs/templates/coprs/detail/overview.html | 8 ++++++++
.../coprs/views/api_ns/api_general.py | 4 +++-
.../coprs/views/coprs_ns/coprs_general.py | 4 +++-
5 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/frontend/coprs_frontend/coprs/forms.py
b/frontend/coprs_frontend/coprs/forms.py
index 591b38c..049d586 100644
--- a/frontend/coprs_frontend/coprs/forms.py
+++ b/frontend/coprs_frontend/coprs/forms.py
@@ -125,7 +125,7 @@ class CoprFormFactory(object):
validators=[UrlListValidator()],
filters=[StringListFilter()])
- auto_createrepo = wtforms.BooleanField()
+ auto_createrepo = wtforms.BooleanField(default=True)
@property
def selected_chroots(self):
diff --git a/frontend/coprs_frontend/coprs/logic/coprs_logic.py
b/frontend/coprs_frontend/coprs/logic/coprs_logic.py
index 45e1a1d..43db461 100644
--- a/frontend/coprs_frontend/coprs/logic/coprs_logic.py
+++ b/frontend/coprs_frontend/coprs/logic/coprs_logic.py
@@ -127,13 +127,14 @@ class CoprsLogic(object):
@classmethod
def add(cls, user, name, repos, selected_chroots, description,
- instructions, check_for_duplicates=False):
+ instructions, auto_createrepo, check_for_duplicates=False):
copr = models.Copr(name=name,
repos=repos,
owner=user,
description=description,
instructions=instructions,
- created_on=int(time.time()))
+ created_on=int(time.time()),
+ auto_createrepo=auto_createrepo)
# form validation checks for duplicates
CoprsLogic.new(user, copr,
diff --git a/frontend/coprs_frontend/coprs/templates/coprs/detail/overview.html
b/frontend/coprs_frontend/coprs/templates/coprs/detail/overview.html
index 64afb47..ce0a193 100644
--- a/frontend/coprs_frontend/coprs/templates/coprs/detail/overview.html
+++ b/frontend/coprs_frontend/coprs/templates/coprs/detail/overview.html
@@ -85,6 +85,14 @@
</ul>
{% endif %}
+ {% if g.user and g.user.can_edit(copr) %}
+ <div>
+
+ <h2>Release options</h2>
+ <button>Run createrepo</button>
+ </div>
+ {% endif %}
+
{% for chroot in copr.modified_chroots %}
<div id="dialog-{{chroot.name}}" class="hidden"
title="{{chroot.name}} minimal buildroot">
<ul>
diff --git a/frontend/coprs_frontend/coprs/views/api_ns/api_general.py
b/frontend/coprs_frontend/coprs/views/api_ns/api_general.py
index 3875883..1e21a1e 100644
--- a/frontend/coprs_frontend/coprs/views/api_ns/api_general.py
+++ b/frontend/coprs_frontend/coprs/views/api_ns/api_general.py
@@ -88,7 +88,9 @@ def api_new_copr(username):
selected_chroots=form.selected_chroots,
description=form.description.data,
instructions=form.instructions.data,
- check_for_duplicates=True)
+ check_for_duplicates=True,
+ auto_createrepo=form.auto_createrepo.data
+ )
infos.append("New project was successfully created.")
if form.initial_pkgs.data:
diff --git a/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
b/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
index dab0160..9153562 100644
--- a/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
+++ b/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
@@ -136,7 +136,9 @@ def copr_new(username):
repos=form.repos.data.replace("\n", " "),
selected_chroots=form.selected_chroots,
description=form.description.data,
- instructions=form.instructions.data)
+ instructions=form.instructions.data,
+ auto_createrepo=form.auto_createrepo.data,
+ )
db.session.commit()
flask.flash("New project was successfully created.")