[copr] master: Automatic commit of package [copr] release [1.25-1]. (ea21f15)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit ea21f158ab5e189bf7aef3338fd256da0fec40aa
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Jan 27 21:36:09 2014 +0100
Automatic commit of package [copr] release [1.25-1].
>---------------------------------------------------------------
copr.spec | 43 ++++++++++++++++++++++++++++++++++++++++++-
rel-eng/packages/copr | 2 +-
2 files changed, 43 insertions(+), 2 deletions(-)
diff --git a/copr.spec b/copr.spec
index ca40be4..079f226 100644
--- a/copr.spec
+++ b/copr.spec
@@ -9,7 +9,7 @@
%global modulename copr
Name: copr
-Version: 1.24
+Version: 1.25
Release: 1%{?dist}
Summary: Cool Other Package Repo
@@ -408,6 +408,47 @@ fi
%endif # with_server
%changelog
+* Mon Jan 27 2014 Miroslav Suchý <msuchy(a)redhat.com> 1.25-1
+- 1044085 - move timezone modification out of template and make it actually
+ work
+- clean up temp data if any
+- [db] timezone can be nullable
+- [frontend] actually save the timezone to model
+- fix colision of revision id
+- 1044085 - frontend: display time in user timezone
+- [frontend] rebuild stuck task
+- disable test on i386
+- use experimental createrepo_c to get rid of lock on temp files
+- [frontend] - do not throw ISE when build_id is malformed
+- [tests] add test for BuildLogic.add
+- [tests] add test for build resubmission
+- [frontend] permission checking is done in BuildLogic.add
+- [frontend] remove BuildLogic.new, use BL.add only
+- [api] fix validation error handling
+- [cli] fix initial_pkgs and repos not sent to backend
+- [frontend] fix BuildsLogic.new not assigning copr to build
+- [frontend] allow resubmitting builds from monitor
+- [frontend] allow GET on repeat_build
+- [frontend] 1050904 - monitor shows not submitted chroots
+- [frontend] rename active_mock_chroots to active_chroots
+- [frontend] rename MockChroot.chroot_name to .name
+- [frontend] 1054474 - drop Copr.build_count nonsense
+- [tests] fix https and repo generation
+- [tests] return exit code from manage.py test
+- 1054472 - Fix deleting multiple SRPMs
+- [spec] tighten acl on copr-be.conf
+- [backend] - add missing import
+- 1054082 - general: encode to utf8 if err in mimetext
+- [backend] lock log file before writing
+- 1055594 - mockremote: always unquote pkg url
+- 1054086 - change vendor tag
+- mockremote: rawhide instead of $releasever in repos when in rawhide chroot
+- 1055499 - do not replace version with $releasever on rawhide
+- 1055119 - do not propagate https until it is properly signed
+- fix spellings on chroot edit page
+- 1054341 - be more verbose about allowed licenses
+- 1054594 - temporary disable https in repo file
+
* Thu Jan 16 2014 Miroslav Suchý <msuchy(a)redhat.com> 1.24-1
- add BR python-markdown
- [fronted] don't add description to .repo files
diff --git a/rel-eng/packages/copr b/rel-eng/packages/copr
index 1d3d9e7..89f3b98 100644
--- a/rel-eng/packages/copr
+++ b/rel-eng/packages/copr
@@ -1 +1 @@
-1.24-1 ./
+1.25-1 ./
10 years, 3 months
[copr] master: Operator not preceded by a space (169226a)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 169226a181f2dc2c3895b2567f1773276554da43
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Jan 27 20:26:28 2014 +0100
Operator not preceded by a space
>---------------------------------------------------------------
coprs_frontend/coprs/models.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/coprs_frontend/coprs/models.py b/coprs_frontend/coprs/models.py
index e51151e..1fc0e91 100644
--- a/coprs_frontend/coprs/models.py
+++ b/coprs_frontend/coprs/models.py
@@ -148,7 +148,7 @@ class User(db.Model, Serializer):
user_tz = pytz.timezone(self.timezone)
else:
user_tz = utc_tz
- dt_aware=datetime.datetime.fromtimestamp(time_in).replace(tzinfo=utc_tz)
+ dt_aware = datetime.datetime.fromtimestamp(time_in).replace(tzinfo=utc_tz)
dt_my_tz = dt_aware.astimezone(user_tz)
return dt_my_tz.strftime(format_tz)
10 years, 3 months
[copr] master: add date to data for test builds (84da5ba)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 84da5ba7c0b67a10c4570e92620bbafe3f09973e
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Jan 27 10:47:20 2014 +0100
add date to data for test builds
9223372036854775807 is maximum integer value in sqlite3
But time.gmtime takes it in millisecons so we need to divede that number by 1000.
addressing:
=================================== FAILURES ===================================
_____ TestWaitingBuilds.test_waiting_build_only_lists_not_started_or_ended _____
self = <test_backend_general.TestWaitingBuilds object at 0x496ac10>
f_users = None, f_coprs = None, f_mock_chroots = None, f_builds = None
f_db = None
def test_waiting_build_only_lists_not_started_or_ended(
self, f_users, f_coprs, f_mock_chroots, f_builds, f_db):
r = self.tc.get('/backend/waiting/', headers=self.auth_header)
> assert len(json.loads(r.data)['builds']) == 4
E assert 5 == 4
E + where 5 = len([{u'buildroot_pkgs': None, u'canceled': False, u'chroot': u'fedora-17-x86_64', u'copr': {u'id': 2, u'name': u'foocopr'... u'chroot': u'fedora-17-i386', u'copr': {u'id': 2, u'name': u'foocopr', u'owner': {u'id': 2, u'name': u'user2'}}, ...}])
tests/test_views/test_backend_ns/test_backend_general.py:15: AssertionError
>---------------------------------------------------------------
coprs_frontend/tests/coprs_test_case.py | 4 +-
.../test_backend_ns/test_backend_general.py | 39 +++++++++++---------
2 files changed, 23 insertions(+), 20 deletions(-)
diff --git a/coprs_frontend/tests/coprs_test_case.py b/coprs_frontend/tests/coprs_test_case.py
index 20110f6..3a20a77 100644
--- a/coprs_frontend/tests/coprs_test_case.py
+++ b/coprs_frontend/tests/coprs_test_case.py
@@ -110,9 +110,9 @@ class CoprsTestCase(object):
@pytest.fixture
def f_builds(self):
self.b1 = models.Build(
- copr=self.c1, user=self.u1, submitted_on=50, started_on=100)
+ copr=self.c1, user=self.u1, submitted_on=50, started_on=9223372036854770)
self.b2 = models.Build(
- copr=self.c1, user=self.u2, submitted_on=10, ended_on=150)
+ copr=self.c1, user=self.u2, submitted_on=10, ended_on=9223372036854775)
self.b3 = models.Build(
copr=self.c2, user=self.u2, submitted_on=10)
self.b4 = models.Build(
diff --git a/coprs_frontend/tests/test_views/test_backend_ns/test_backend_general.py b/coprs_frontend/tests/test_views/test_backend_ns/test_backend_general.py
index aa0e70e..e60f28b 100644
--- a/coprs_frontend/tests/test_views/test_backend_ns/test_backend_general.py
+++ b/coprs_frontend/tests/test_views/test_backend_ns/test_backend_general.py
@@ -12,9 +12,12 @@ class TestWaitingBuilds(CoprsTestCase):
self, f_users, f_coprs, f_mock_chroots, f_builds, f_db):
r = self.tc.get('/backend/waiting/', headers=self.auth_header)
+ #import sys
+ #sys.stderr.write(r.data)
assert len(json.loads(r.data)['builds']) == 4
-
+# status = 0 # failure
+# status = 1 # succeeded
class TestUpdateBuilds(CoprsTestCase):
data1= """
{
@@ -23,7 +26,7 @@ class TestUpdateBuilds(CoprsTestCase):
"id": 1,
"copr_id": 2,
"results": "http://server/results/foo/bar/",
- "started_on": 1234
+ "started_on": 9223372036854775
}
]
}"""
@@ -36,7 +39,7 @@ class TestUpdateBuilds(CoprsTestCase):
"copr_id": 2,
"status": 1,
"chroot": "fedora-18-x86_64",
- "ended_on": 12345
+ "ended_on": 9223372036854775
}
]
}"""
@@ -47,7 +50,7 @@ class TestUpdateBuilds(CoprsTestCase):
{
"id": 1,
"copr_id": 2,
- "started_on": 1234
+ "started_on": 9223372036854775
},
{
"id": 2,
@@ -55,19 +58,19 @@ class TestUpdateBuilds(CoprsTestCase):
"status": 0,
"chroot": "fedora-18-x86_64",
"results": "http://server/results/foo/bar/",
- "ended_on": 123456
+ "ended_on": 9223372036854775
},
{
"id": 123321,
"copr_id": 1,
"status": 0,
- "ended_on": 123456
+ "ended_on": 9223372036854775
},
{
"id": 1234321,
"copr_id": 2,
"results": "http://server/results/foo/bar/",
- "started_on": 1234
+ "started_on": 9223372036854775
}
]
}"""
@@ -91,7 +94,7 @@ class TestUpdateBuilds(CoprsTestCase):
updated = self.models.Build.query.filter(self.models.Build.id==1).first()
assert updated.results == 'http://server/results/foo/bar/'
- assert updated.started_on == 1234
+ assert updated.started_on == 9223372036854775
def test_update_build_ended(self, f_users, f_coprs, f_mock_chroots, f_builds, f_db):
r = self.tc.post('/backend/update/',
@@ -103,7 +106,7 @@ class TestUpdateBuilds(CoprsTestCase):
updated = self.models.Build.query.filter(self.models.Build.id==1).first()
assert updated.status == 1
- assert updated.ended_on == 12345
+ assert updated.ended_on == 9223372036854775
def test_update_more_existent_and_non_existent_builds(
self, f_users, f_coprs, f_mock_chroots, f_builds, f_db):
@@ -121,12 +124,12 @@ class TestUpdateBuilds(CoprsTestCase):
assert sorted(json.loads(r.data)["non_existing_builds_ids"]) == [123321, 1234321]
started = self.models.Build.query.filter(self.models.Build.id==1).first()
- assert started.started_on == 1234
+ assert started.started_on == 9223372036854775
ended = self.models.Build.query.filter(self.models.Build.id==2).first()
assert ended.status == 0
assert ended.results == 'http://server/results/foo/bar/'
- assert ended.ended_on == 123456
+ assert ended.ended_on == 9223372036854775
def test_build_ended_emmits_signal(self, f_users, f_coprs, f_builds, f_db):
# TODO: this should probably be mocked...
@@ -158,7 +161,7 @@ class TestUpdateActions(CoprsTestCase):
"id": 1,
"result": 1,
"message": "no problem",
- "ended_on": 123
+ "ended_on": 9223372036854770
}
]
}"""
@@ -169,19 +172,19 @@ class TestUpdateActions(CoprsTestCase):
"id": 1,
"result": 1,
"message": null,
- "ended_on": 1234
+ "ended_on": 9223372036854775
},
{
"id": 2,
"result": 2,
"message": "problem!",
- "ended_on": 12345
+ "ended_on": 9223372036854775
},
{
"id": 100,
"result": 123,
"message": "wheeeee!",
- "ended_on": 123456
+ "ended_on": 9223372036854775
}
]
}"""
@@ -197,7 +200,7 @@ class TestUpdateActions(CoprsTestCase):
updated = self.models.Action.query.filter(self.models.Action.id==1).first()
assert updated.result == 1
assert updated.message == "no problem"
- assert updated.ended_on == 123
+ assert updated.ended_on == 9223372036854770
def test_update_more_existent_and_non_existent_actions(self, f_users, f_coprs, f_actions, f_db):
r = self.tc.post('/backend/update/',
@@ -210,9 +213,9 @@ class TestUpdateActions(CoprsTestCase):
updated = self.models.Action.query.filter(self.models.Action.id==1).first()
assert updated.result == 1
assert updated.message == None
- assert updated.ended_on == 1234
+ assert updated.ended_on == 9223372036854775
updated2 = self.models.Action.query.filter(self.models.Action.id==2).first()
assert updated2.result == 2
assert updated2.message == "problem!"
- assert updated2.ended_on == 12345
+ assert updated2.ended_on == 9223372036854775
10 years, 3 months
[copr] master: remove unused import (559c620)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 559c6206b9058440d2802b478598e13283c091e2
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Jan 27 20:25:52 2014 +0100
remove unused import
>---------------------------------------------------------------
coprs_frontend/coprs/models.py | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/coprs_frontend/coprs/models.py b/coprs_frontend/coprs/models.py
index 6ebe6b6..e51151e 100644
--- a/coprs_frontend/coprs/models.py
+++ b/coprs_frontend/coprs/models.py
@@ -2,8 +2,6 @@ import datetime
import markdown
import pytz
-from dateutil import tz
-
from sqlalchemy.ext.associationproxy import association_proxy
from libravatar import libravatar_url
10 years, 3 months
[copr] master: rename tests to avoid confuse (7a00a3c)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 7a00a3c613dc19a8dc79ec7c2d1dd40218eef46b
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Jan 27 10:42:22 2014 +0100
rename tests to avoid confuse
>---------------------------------------------------------------
.../test_backend_ns/test_backend_general.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/coprs_frontend/tests/test_views/test_backend_ns/test_backend_general.py b/coprs_frontend/tests/test_views/test_backend_ns/test_backend_general.py
index 322f01d..aa0e70e 100644
--- a/coprs_frontend/tests/test_views/test_backend_ns/test_backend_general.py
+++ b/coprs_frontend/tests/test_views/test_backend_ns/test_backend_general.py
@@ -143,10 +143,10 @@ class TestUpdateBuilds(CoprsTestCase):
assert signals_received[0].id == 2
class TestWaitingActions(CoprsTestCase):
- def test_no_waiting_builds(self):
+ def test_no_waiting_actions(self):
assert '"actions": []' in self.tc.get('/backend/waiting/', headers=self.auth_header).data
- def test_waiting_build_only_lists_not_started_or_ended(self, f_users, f_coprs, f_actions, f_db):
+ def test_waiting_actions_only_lists_not_started_or_ended(self, f_users, f_coprs, f_actions, f_db):
r = self.tc.get('/backend/waiting/', headers=self.auth_header)
assert len(json.loads(r.data)['actions']) == 2
@@ -199,7 +199,7 @@ class TestUpdateActions(CoprsTestCase):
assert updated.message == "no problem"
assert updated.ended_on == 123
- def test_update_more_existent_and_non_existent_builds(self, f_users, f_coprs, f_actions, f_db):
+ def test_update_more_existent_and_non_existent_actions(self, f_users, f_coprs, f_actions, f_db):
r = self.tc.post('/backend/update/',
content_type='application/json',
headers=self.auth_header,
10 years, 3 months
[copr] master: [db] timezone can be nullable (3fcfc20)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 3fcfc20116db4add4ffdbda5f96ddfa8abf31034
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jan 24 14:08:38 2014 +0100
[db] timezone can be nullable
this will
* allow existing user without putting some made-up data
* allow users which do not have TZ set in FAS
>---------------------------------------------------------------
.../versions/498884ac47db_add_timezone_field.py | 2 +-
coprs_frontend/coprs/models.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/coprs_frontend/alembic/versions/498884ac47db_add_timezone_field.py b/coprs_frontend/alembic/versions/498884ac47db_add_timezone_field.py
index 80cda55..add80d4 100644
--- a/coprs_frontend/alembic/versions/498884ac47db_add_timezone_field.py
+++ b/coprs_frontend/alembic/versions/498884ac47db_add_timezone_field.py
@@ -16,7 +16,7 @@ import sqlalchemy as sa
def upgrade():
""" Add 'data' colum to action table. """
- op.add_column('user', sa.Column('timezone', sa.String(length=50), nullable=False))
+ op.add_column('user', sa.Column('timezone', sa.String(length=50), nullable=True))
def downgrade():
diff --git a/coprs_frontend/coprs/models.py b/coprs_frontend/coprs/models.py
index 2960680..2f2fc79 100644
--- a/coprs_frontend/coprs/models.py
+++ b/coprs_frontend/coprs/models.py
@@ -62,7 +62,7 @@ class User(db.Model, Serializer):
# just mail :)
mail = db.Column(db.String(150), nullable = False)
# just timezone ;)
- timezone = db.Column(db.String(50), nullable = False)
+ timezone = db.Column(db.String(50), nullable = True)
# is this user proven? proven users can modify builder memory and timeout for single builds
proven = db.Column(db.Boolean, default = False)
# is this user admin of the system?
10 years, 3 months
[copr] master: [frontend] actually save the timezone to model (079053e)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 079053ee851e4e1baecf19307cbfa860b4a34e7a
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jan 24 13:41:32 2014 +0100
[frontend] actually save the timezone to model
>---------------------------------------------------------------
coprs_frontend/coprs/views/misc.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/coprs_frontend/coprs/views/misc.py b/coprs_frontend/coprs/views/misc.py
index b78e490..3abfa5e 100644
--- a/coprs_frontend/coprs/views/misc.py
+++ b/coprs_frontend/coprs/views/misc.py
@@ -49,6 +49,7 @@ def create_or_login(resp):
+ datetime.timedelta(days=flask.current_app.config['API_TOKEN_EXPIRATION'])
copr64 = base64.b64encode('copr') + '##'
user = models.User(openid_name = resp.identity_url, mail = resp.email,
+ timezone = resp.timezone,
api_login = copr64 + helpers.generate_api_token(
app.config['API_TOKEN_LENGTH'] - len(copr64)),
api_token = helpers.generate_api_token(app.config['API_TOKEN_LENGTH']),
10 years, 3 months
[copr] master: [frontend] rebuild stuck task (0bb465d)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 0bb465d9971688ad83e4b7468ee0da40d53f8bf0
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jan 24 13:13:09 2014 +0100
[frontend] rebuild stuck task
If something started and did not finished withing 2 hours, then it is likely
stuck. Put it in waiting queue again
>---------------------------------------------------------------
coprs_frontend/coprs/logic/builds_logic.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/coprs_frontend/coprs/logic/builds_logic.py b/coprs_frontend/coprs/logic/builds_logic.py
index 7554845..f2a0b85 100644
--- a/coprs_frontend/coprs/logic/builds_logic.py
+++ b/coprs_frontend/coprs/logic/builds_logic.py
@@ -47,7 +47,7 @@ class BuildsLogic(object):
join(models.User).\
options(db.contains_eager(models.Build.copr)).\
options(db.contains_eager('copr.owner')).\
- filter(models.Build.started_on == None).\
+ filter((models.Build.started_on == None) | (models.Build.started_on < int(time.time()-7200))).\
filter(models.Build.ended_on == None).\
filter(models.Build.canceled != True).\
order_by(models.Build.submitted_on.asc())
10 years, 3 months
[copr] master: clean up temp data if any (e91f1d9)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit e91f1d941f3c8e904aee99f567d5a1de439845b6
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jan 24 16:05:09 2014 +0100
clean up temp data if any
>---------------------------------------------------------------
copr.spec | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/copr.spec b/copr.spec
index 50fbe66..93c4cf9 100644
--- a/copr.spec
+++ b/copr.spec
@@ -285,6 +285,7 @@ install -p -m 644 man/%{name}-selinux-relabel.8 %{buildroot}/%{_mandir}/man8/
%check
%if %{with_test} && %{with_server} && %{_arch} == "x86_64"
pushd coprs_frontend
+ rm -rf /tmp/copr.db /tmp/whooshee || :
COPR_CONFIG="$(pwd)/config/copr_unit_test.conf" ./manage.py test
popd
%endif
10 years, 3 months
[copr] master: 1044085 - frontend: display time in user timezone (5f03d48)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 5f03d4899c4d44cfdaf617b2615d25ad27835dd6
Author: Igor Gnatenko <i.gnatenko.brain(a)gmail.com>
Date: Thu Jan 23 12:25:28 2014 +0400
1044085 - frontend: display time in user timezone
Signed-off-by: Igor Gnatenko <i.gnatenko.brain(a)gmail.com>
>---------------------------------------------------------------
..._fiel.py => 498884ac47db_add_timezone_field.py} | 12 ++++++------
coprs_frontend/coprs/models.py | 2 ++
.../templates/coprs/detail/_builds_table.html | 15 ++++++++++++---
coprs_frontend/coprs/views/misc.py | 2 +-
4 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/coprs_frontend/alembic/versions/294405dfc7c0_add_action_data_fiel.py b/coprs_frontend/alembic/versions/498884ac47db_add_timezone_field.py
similarity index 53%
copy from coprs_frontend/alembic/versions/294405dfc7c0_add_action_data_fiel.py
copy to coprs_frontend/alembic/versions/498884ac47db_add_timezone_field.py
index 6463cf5..5c5948b 100644
--- a/coprs_frontend/alembic/versions/294405dfc7c0_add_action_data_fiel.py
+++ b/coprs_frontend/alembic/versions/498884ac47db_add_timezone_field.py
@@ -1,13 +1,13 @@
-"""add Action.data field
+"""add timezone field
-Revision ID: 294405dfc7c0
+Revision ID: 498884ac47db
Revises: 3a415c6392bc
-Create Date: 2014-01-20 15:43:09.986912
+Create Date: 2014-01-23 12:15:04.450292
"""
# revision identifiers, used by Alembic.
-revision = '294405dfc7c0'
+revision = '498884ac47db'
down_revision = '3a415c6392bc'
from alembic import op
@@ -16,9 +16,9 @@ import sqlalchemy as sa
def upgrade():
""" Add 'data' colum to action table. """
- op.add_column('action', sa.Column('data', sa.Text()))
+ op.add_column('user', sa.Column('timezone', sa.String(length=50), nullable=False))
def downgrade():
""" Drop 'data' colum from action table. """
- op.drop_column('action', 'data')
+ op.drop_column('user', 'timezone')
diff --git a/coprs_frontend/coprs/models.py b/coprs_frontend/coprs/models.py
index 0dbf7df..2960680 100644
--- a/coprs_frontend/coprs/models.py
+++ b/coprs_frontend/coprs/models.py
@@ -61,6 +61,8 @@ class User(db.Model, Serializer):
openid_name = db.Column(db.String(100), nullable = False)
# just mail :)
mail = db.Column(db.String(150), nullable = False)
+ # just timezone ;)
+ timezone = db.Column(db.String(50), nullable = False)
# is this user proven? proven users can modify builder memory and timeout for single builds
proven = db.Column(db.Boolean, default = False)
# is this user admin of the system?
diff --git a/coprs_frontend/coprs/templates/coprs/detail/_builds_table.html b/coprs_frontend/coprs/templates/coprs/detail/_builds_table.html
index a70b53c..ef95297 100644
--- a/coprs_frontend/coprs/templates/coprs/detail/_builds_table.html
+++ b/coprs_frontend/coprs/templates/coprs/detail/_builds_table.html
@@ -1,4 +1,13 @@
{% from "coprs/detail/_builds_forms.html" import copr_build_cancel_form, copr_build_repeat_form, copr_build_delete_form %}
+{% from datetime import datetime %}
+{% from dateutil import tz %}
+{{ format_tz = "%%d-%%m-%%y %%H:%%M:%%S" }}
+{{ utc_tz = tz.tzutc() }}
+{% if g.user.timezone %}
+ {{ user_tz = g.user.timezone }}
+{% else %}
+ {{ user_tz = utc_tz }}
+{% endif %}
{% macro builds_table(builds) %}
{% if builds %}
@@ -14,10 +23,10 @@
{% for build in builds %}
<tr class="build-{{ build.state }} build-state">
<td>{{ build.id }}</td>
- <td>{{ build.submitted_on|date_from_secs }}</td>
+ <td>{{ datetime.strptime(build.submitted_on|date_from_secs, format_tz).replace(tzinfo=utc_tz).astimezone(g.user.timezone).strftime(format_tz) }}</td>
<td>{{ build.user.name }}</td>
- <td>{{ build.started_on|date_from_secs or 'Not yet' }}</td>
- <td>{{ build.ended_on|date_from_secs or 'Not yet' }}</td>
+ <td>{{ datetime.strptime(build.started_on|date_from_secs, format_tz).replace(tzinfo=utc_tz).astimezone(g.user.timezone).strftime(format_tz) or 'Not yet' }}</td>
+ <td>{{ datetime.strptime(build.ended_on|date_from_secs, format_tz).replace(tzinfo=utc_tz).astimezone(g.user.timezone).strftime(format_tz) or 'Not yet' }}</td>
<td>{{ build.state }}</td>
</tr>
<tr class="details">
diff --git a/coprs_frontend/coprs/views/misc.py b/coprs_frontend/coprs/views/misc.py
index 3f2b953..b78e490 100644
--- a/coprs_frontend/coprs/views/misc.py
+++ b/coprs_frontend/coprs/views/misc.py
@@ -33,7 +33,7 @@ def login():
if flask.g.user is not None:
return flask.redirect(oid.get_next_url())
else:
- return oid.try_login('https://id.fedoraproject.org/', ask_for=['email'])
+ return oid.try_login('https://id.fedoraproject.org/', ask_for=['email', 'timezone'])
@oid.after_login
def create_or_login(resp):
10 years, 3 months