Repository :
http://git.fedorahosted.org/cgit/copr.git
On branch : new
---------------------------------------------------------------
commit a05b56c061557f0e0cc9d4530d86e210643a016c
Author: Richard Marko <rmarko(a)fedoraproject.org>
Date: Tue Jan 21 12:58:21 2014 +0100
[frontend] rename active_mock_chroots to active_chroots
Signed-off-by: Richard Marko <rmarko(a)fedoraproject.org>
---------------------------------------------------------------
coprs_frontend/coprs/logic/builds_logic.py | 2 +-
coprs_frontend/coprs/models.py | 2 +-
.../coprs/templates/coprs/detail/overview.html | 16 ++++++++--------
coprs_frontend/coprs/templates/coprs/show.html | 2 +-
coprs_frontend/coprs/views/api_ns/api_general.py | 2 +-
coprs_frontend/tests/coprs_test_case.py | 2 +-
6 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/coprs_frontend/coprs/logic/builds_logic.py
b/coprs_frontend/coprs/logic/builds_logic.py
index dc4851c..05ce536 100644
--- a/coprs_frontend/coprs/logic/builds_logic.py
+++ b/coprs_frontend/coprs/logic/builds_logic.py
@@ -83,7 +83,7 @@ class BuildsLogic(object):
# add BuildChroot object for each active chroot
# this copr is assigned to
- for chroot in copr.active_mock_chroots:
+ for chroot in copr.active_chroots:
buildchroot = models.BuildChroot(
build=build,
mock_chroot=chroot)
diff --git a/coprs_frontend/coprs/models.py b/coprs_frontend/coprs/models.py
index 5f733f3..0dbf7df 100644
--- a/coprs_frontend/coprs/models.py
+++ b/coprs_frontend/coprs/models.py
@@ -177,7 +177,7 @@ class Copr(db.Model, Serializer):
return md.convert(self.instructions) or 'Instructions not filled in by
author. Author knows what to do. Everybody else should avoid this repo.'
@property
- def active_mock_chroots(self):
+ def active_chroots(self):
"""Returns list of active mock_chroots of this
copr"""
return filter(lambda x: x.is_active, self.mock_chroots)
diff --git a/coprs_frontend/coprs/templates/coprs/detail/overview.html
b/coprs_frontend/coprs/templates/coprs/detail/overview.html
index 7e2e0f8..d3bca61 100644
--- a/coprs_frontend/coprs/templates/coprs/detail/overview.html
+++ b/coprs_frontend/coprs/templates/coprs/detail/overview.html
@@ -20,10 +20,10 @@
<th>Architecture</th>
<th class="rightmost">Yum Repo</th>
</tr>
- {% for mock_chroot in copr.active_mock_chroots %}
- {% if loop.index < copr.active_mock_chroots|length %}
- {% if mock_chroot.os_release != copr.active_mock_chroots[loop.index].os_release
or
- mock_chroot.os_version != copr.active_mock_chroots[loop.index].os_version
%}
+ {% for mock_chroot in copr.active_chroots %}
+ {% if loop.index < copr.active_chroots|length %}
+ {% if mock_chroot.os_release != copr.active_chroots[loop.index].os_release or
+ mock_chroot.os_version != copr.active_chroots[loop.index].os_version %}
{# next release is different => release-end #}
<tr class="release-end">
{% else %}
@@ -32,8 +32,8 @@
{% else %}{# last line => release-end for sure #}
<tr class="release-end">
{% endif %}
- {% if mock_chroot.os_release != copr.active_mock_chroots[loop.index0 -
1].os_release or
- mock_chroot.os_version != copr.active_mock_chroots[loop.index0 - 1].os_version or
+ {% if mock_chroot.os_release != copr.active_chroots[loop.index0 - 1].os_release
or
+ mock_chroot.os_version != copr.active_chroots[loop.index0 - 1].os_version or
loop.index0 == 0 %}
{# previous os_release-os_version were different or this is the first one #}
<td>{{ mock_chroot.os_release|capitalize }} {{ mock_chroot.os_version
}}</td>
@@ -41,8 +41,8 @@
<td></td>
{% endif %}
<td>{{ mock_chroot.arch }}</td>
- {% if mock_chroot.os_release != copr.active_mock_chroots[loop.index0 -
1].os_release or
- mock_chroot.os_version != copr.active_mock_chroots[loop.index0 - 1].os_version
or
+ {% if mock_chroot.os_release != copr.active_chroots[loop.index0 - 1].os_release
or
+ mock_chroot.os_version != copr.active_chroots[loop.index0 - 1].os_version or
loop.index0 == 0 %}
{# previous os_release-os_version were different or this is the first one #}
<td><a href="{{ url_for(
diff --git a/coprs_frontend/coprs/templates/coprs/show.html
b/coprs_frontend/coprs/templates/coprs/show.html
index 9f8abe7..2533171 100644
--- a/coprs_frontend/coprs/templates/coprs/show.html
+++ b/coprs_frontend/coprs/templates/coprs/show.html
@@ -31,7 +31,7 @@
<a class="coprs-list" href="{{
url_for('coprs_ns.copr_detail', username = copr.owner.name, coprname = copr.name)
}}">{{ copr.owner.name }}/{{ copr.name }}</a>
<p>{{ copr.description_or_not_filled|safe }}</p>
<p class="repos">
- {% for mock_chroot in copr.active_mock_chroots %}
+ {% for mock_chroot in copr.active_chroots %}
{{ mock_chroot.os_release|os_name_short(mock_chroot.os_version) }}.{{
mock_chroot.arch }}{% if not loop.last %}, {% endif %}
{% endfor %}
</p>
diff --git a/coprs_frontend/coprs/views/api_ns/api_general.py
b/coprs_frontend/coprs/views/api_ns/api_general.py
index 550b007..0e931d0 100644
--- a/coprs_frontend/coprs/views/api_ns/api_general.py
+++ b/coprs_frontend/coprs/views/api_ns/api_general.py
@@ -124,7 +124,7 @@ def api_coprs_by_owner(username=None):
yum_repos = {}
for build in repo.builds:
if build.results:
- for chroot in repo.active_mock_chroots:
+ for chroot in repo.active_chroots:
release =
'{chroot.os_release}-{chroot.os_version}-{chroot.arch}'.format(chroot=chroot)
yum_repos[release] = urlparse.urljoin(build.results, release +
'/')
break
diff --git a/coprs_frontend/tests/coprs_test_case.py
b/coprs_frontend/tests/coprs_test_case.py
index 8ff9c60..20110f6 100644
--- a/coprs_frontend/tests/coprs_test_case.py
+++ b/coprs_frontend/tests/coprs_test_case.py
@@ -121,7 +121,7 @@ class CoprsTestCase(object):
for build in [self.b1, self.b2, self.b3, self.b4]:
self.db.session.add(build)
- for chroot in build.copr.active_mock_chroots:
+ for chroot in build.copr.active_chroots:
buildchroot = models.BuildChroot(
build=build,
mock_chroot=chroot)