[copr] master: [frontend] delete all builds with their project (5c61413)
by asamalik@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 5c614139fd06bdc356dafeb45976ee590a6a248a
Author: Adam Samalik <asamalik(a)redhat.com>
Date: Thu Mar 27 12:48:31 2014 +0100
[frontend] delete all builds with their project
>---------------------------------------------------------------
.../coprs/views/coprs_ns/coprs_general.py | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
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 3cb6c93..709cb1f 100644
--- a/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
+++ b/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
@@ -371,7 +371,11 @@ def copr_delete(username, coprname):
copr = coprs_logic.CoprsLogic.get(flask.g.user, username, coprname).first()
if form.validate_on_submit() and copr:
+ builds_query = builds_logic.BuildsLogic.get_multiple(
+ flask.g.user, copr=copr)
try:
+ for build in builds_query:
+ builds_logic.BuildsLogic.delete_build(flask.g.user, build)
coprs_logic.CoprsLogic.delete(flask.g.user, copr)
except (exceptions.ActionInProgressException,
exceptions.InsufficientRightsException) as e:
10 years
[copr] master: [frontend] config comments (2ef1088)
by asamalik@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 2ef108849ea62335f5937682646c398e29f5e690
Author: Adam Samalik <asamalik(a)redhat.com>
Date: Thu Mar 27 11:31:22 2014 +0100
[frontend] config comments
>---------------------------------------------------------------
frontend/coprs_frontend/config/copr.conf | 3 ++-
frontend/coprs_frontend/config/copr_devel.conf | 3 ++-
frontend/coprs_frontend/config/copr_unit_test.conf | 1 +
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/frontend/coprs_frontend/config/copr.conf b/frontend/coprs_frontend/config/copr.conf
index 2397d21..2d39d3b 100644
--- a/frontend/coprs_frontend/config/copr.conf
+++ b/frontend/coprs_frontend/config/copr.conf
@@ -34,5 +34,6 @@ SQLALCHEMY_ECHO = False
#CSRF_ENABLED = True
# as of Flask-WTF 0.9+
#WTF_CSRF_ENABLED = True
-#
+
+# send emails when user's perms change in project?
SEND_EMAILS = True
diff --git a/frontend/coprs_frontend/config/copr_devel.conf b/frontend/coprs_frontend/config/copr_devel.conf
index cab20c8..a5ae360 100644
--- a/frontend/coprs_frontend/config/copr_devel.conf
+++ b/frontend/coprs_frontend/config/copr_devel.conf
@@ -31,5 +31,6 @@ SQLALCHEMY_ECHO = True
#CSRF_ENABLED = True
# as of Flask-WTF 0.9+
#WTF_CSRF_ENABLED = True
-#
+
+# send emails when user's perms change in project?
SEND_EMAILS = True
diff --git a/frontend/coprs_frontend/config/copr_unit_test.conf b/frontend/coprs_frontend/config/copr_unit_test.conf
index 1285420..b8de251 100644
--- a/frontend/coprs_frontend/config/copr_unit_test.conf
+++ b/frontend/coprs_frontend/config/copr_unit_test.conf
@@ -32,4 +32,5 @@ CSRF_ENABLED = False
# as of Flask-WTF 0.9+
WTF_CSRF_ENABLED = False
+# send emails when user's perms change in project?
SEND_EMAILS = False
10 years
[copr] master: [frontend] sending emails when perms change (9ac6313)
by asamalik@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 9ac6313ffa673f796c11559dc405a73f2aeec89c
Author: Adam Samalik <asamalik(a)redhat.com>
Date: Mon Mar 24 14:43:43 2014 +0100
[frontend] sending emails when perms change
>---------------------------------------------------------------
frontend/coprs_frontend/config/copr.conf | 2 +
frontend/coprs_frontend/config/copr_devel.conf | 2 +
frontend/coprs_frontend/config/copr_unit_test.conf | 2 +
.../coprs/views/coprs_ns/coprs_general.py | 50 ++++++++++++++++++++
4 files changed, 56 insertions(+), 0 deletions(-)
diff --git a/frontend/coprs_frontend/config/copr.conf b/frontend/coprs_frontend/config/copr.conf
index e608897..2397d21 100644
--- a/frontend/coprs_frontend/config/copr.conf
+++ b/frontend/coprs_frontend/config/copr.conf
@@ -34,3 +34,5 @@ SQLALCHEMY_ECHO = False
#CSRF_ENABLED = True
# as of Flask-WTF 0.9+
#WTF_CSRF_ENABLED = True
+#
+SEND_EMAILS = True
diff --git a/frontend/coprs_frontend/config/copr_devel.conf b/frontend/coprs_frontend/config/copr_devel.conf
index 2f139d1..cab20c8 100644
--- a/frontend/coprs_frontend/config/copr_devel.conf
+++ b/frontend/coprs_frontend/config/copr_devel.conf
@@ -31,3 +31,5 @@ SQLALCHEMY_ECHO = True
#CSRF_ENABLED = True
# as of Flask-WTF 0.9+
#WTF_CSRF_ENABLED = True
+#
+SEND_EMAILS = True
diff --git a/frontend/coprs_frontend/config/copr_unit_test.conf b/frontend/coprs_frontend/config/copr_unit_test.conf
index e9de359..1285420 100644
--- a/frontend/coprs_frontend/config/copr_unit_test.conf
+++ b/frontend/coprs_frontend/config/copr_unit_test.conf
@@ -31,3 +31,5 @@ SQLALCHEMY_DATABASE_URI = 'sqlite:///' + DATABASE
CSRF_ENABLED = False
# as of Flask-WTF 0.9+
WTF_CSRF_ENABLED = False
+
+SEND_EMAILS = False
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 f29c590..3cb6c93 100644
--- a/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
+++ b/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
@@ -263,6 +263,12 @@ def copr_permissions_applier_change(username, coprname):
flask.flash("Owner cannot request permissions for his own project.")
elif applier_permissions_form.validate_on_submit():
# we rely on these to be 0 or 1 from form. TODO: abstract from that
+ if permission is not None:
+ old_builder = permission.copr_builder
+ old_admin = permission.copr_admin
+ else:
+ old_builder = 0
+ old_admin = 0
new_builder = applier_permissions_form.copr_builder.data
new_admin = applier_permissions_form.copr_admin.data
coprs_logic.CoprPermissionsLogic.update_permissions_by_applier(
@@ -271,6 +277,30 @@ def copr_permissions_applier_change(username, coprname):
flask.flash(
"Successfuly updated permissions for project '{0}'."
.format(copr.name))
+ admin_mails = [copr.owner.mail]
+ for perm in copr.copr_permissions:
+ # this 2 means that his status (admin) is approved
+ if perm.copr_admin == 2:
+ admin_mails.append(perm.user.mail)
+
+ # sending emails
+ if flask.current_app.config["SEND_EMAILS"]:
+ for mail in admin_mails:
+ msg = MIMEText("{6} is asking for these permissions:\n\n"
+ "Builder: {0} -> {1}\nAdmin: {2} -> {3}\n\n"
+ "Project: {4}\nOwner: {5}".format(
+ helpers.PermissionEnum(old_builder),
+ helpers.PermissionEnum(new_builder),
+ helpers.PermissionEnum(old_admin),
+ helpers.PermissionEnum(new_admin),
+ copr.name, copr.owner.name, flask.g.user.name), "plain")
+ msg["Subject"] = "[Copr] {0}: {1} is asking permissons".format(copr.name, flask.g.user.name)
+ msg["From"] = "root@{0}".format(platform.node())
+ msg["To"] = perm.user.mail
+ s = smtplib.SMTP("localhost")
+ s.sendmail("root@{0}".format(platform.node()),perm.user.mail , msg.as_string())
+ s.quit()
+
return flask.redirect(flask.url_for("coprs_ns.copr_detail",
username=copr.owner.name,
@@ -294,12 +324,32 @@ def copr_update_permissions(username, coprname):
permissions.sort(
cmp=lambda x, y: -1 if y.user_id == flask.g.user.id else 1)
for perm in permissions:
+ old_builder = perm.copr_builder
+ old_admin = perm.copr_admin
new_builder = permissions_form[
"copr_builder_{0}".format(perm.user_id)].data
new_admin = permissions_form[
"copr_admin_{0}".format(perm.user_id)].data
coprs_logic.CoprPermissionsLogic.update_permissions(
flask.g.user, copr, perm, new_builder, new_admin)
+ if flask.current_app.config["SEND_EMAILS"]:
+ if old_builder is not new_builder or \
+ old_admin is not new_admin:
+ msg = MIMEText("Your permissions have changed:\n\n"
+ "Builder: {0} -> {1}\nAdmin: {2} -> {3}\n\n"
+ "Project: {4}\nOwner: {5}".format(
+ helpers.PermissionEnum(old_builder),
+ helpers.PermissionEnum(new_builder),
+ helpers.PermissionEnum(old_admin),
+ helpers.PermissionEnum(new_admin),
+ copr.name, copr.owner.name), "plain")
+ msg["Subject"] = "[Copr] {0}: Your permissions have changed".format(copr.name)
+ msg["From"] = "root@{0}".format(platform.node())
+ msg["To"] = perm.user.mail
+ s = smtplib.SMTP("localhost")
+ s.sendmail("root@{0}".format(platform.node()),perm.user.mail , msg.as_string())
+ s.quit()
+
# for now, we don't check for actions here, as permissions operation
# don't collide with any actions
except exceptions.InsufficientRightsException as e:
10 years
[copr] master: [frontend] typo s/Coper/Copr/ (eb063b5)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit eb063b518cd2c65295829ddeb358ae790aab4ff0
Author: Miroslav Suchý <miroslav(a)suchy.cz>
Date: Tue Mar 25 20:21:17 2014 +0100
[frontend] typo s/Coper/Copr/
>---------------------------------------------------------------
.../coprs_frontend/coprs/templates/coprs/show.html | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/frontend/coprs_frontend/coprs/templates/coprs/show.html b/frontend/coprs_frontend/coprs/templates/coprs/show.html
index c64f765..8bfe36a 100644
--- a/frontend/coprs_frontend/coprs/templates/coprs/show.html
+++ b/frontend/coprs_frontend/coprs/templates/coprs/show.html
@@ -26,7 +26,7 @@
<ol>
<li>choose an architecture and system you want to build for</li>
<li>provide Copr with src.rpm packages available online</li>
- <li>let Coper do all the work and wait for your new repo</li>
+ <li>let Copr do all the work and wait for your new repo</li>
</ol>
<p>For more information please visit <a href="https://fedorahosted.org/copr/">Copr wiki</a></p>
</div>
10 years
[copr] master: api: fix coprs.models.User usage in search (5b05ea9)
by Igor Gnatenko
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 5b05ea9fa5ae7ad069d70118595ea3bda93391e8
Author: Igor Gnatenko <i.gnatenko.brain(a)gmail.com>
Date: Mon Mar 24 08:59:17 2014 +0400
api: fix coprs.models.User usage in search
In 5f785d72 we introduced new search API, but it doesn't work now.
Partial fix in 063530f1, but we have the same traceback:
Traceback (most recent call last):
File
"/usr/lib/python2.7/site-packages/flask/app.py", line 1701, in __call__
return self.wsgi_app(environ,
start_response)
File
"/usr/lib/python2.7/site-packages/flask/app.py", line 1689, in wsgi_app
response =
self.make_response(self.handle_exception(e))
File
"/usr/lib/python2.7/site-packages/flask/app.py", line 1687, in wsgi_app
response = self.full_dispatch_request()
File
"/usr/lib/python2.7/site-packages/flask/app.py", line 1360, in full_dispatch_request
rv = self.handle_user_exception(e)
File
"/usr/lib/python2.7/site-packages/flask/app.py", line 1358, in full_dispatch_request
rv = self.dispatch_request()
File
"/usr/lib/python2.7/site-packages/flask/app.py", line 1344, in dispatch_request
return
self.view_functions[rule.endpoint](**req.view_args)
File
"/usr/share/copr/coprs_frontend/coprs/views/api_ns/api_general.py", line 416, in api_coprs_search_by_project
jsonout = flask.jsonify(output)
File
"/usr/lib/python2.7/site-packages/flask/helpers.py", line 198, in jsonify
indent=None if request.is_xhr else
2), mimetype='application/json')
File
"/usr/lib64/python2.7/json/__init__.py", line 250, in dumps
sort_keys=sort_keys, **kw).encode(obj)
File
"/usr/lib64/python2.7/json/encoder.py", line 209, in encode
chunks = list(chunks)
File
"/usr/lib64/python2.7/json/encoder.py", line 434, in _iterencode
for chunk in _iterencode_dict(o,
_current_indent_level):
File
"/usr/lib64/python2.7/json/encoder.py", line 408, in _iterencode_dict
for chunk in chunks:
File
"/usr/lib64/python2.7/json/encoder.py", line 332, in _iterencode_list
for chunk in chunks:
File
"/usr/lib64/python2.7/json/encoder.py", line 408, in _iterencode_dict
for chunk in chunks:
File
"/usr/lib64/python2.7/json/encoder.py", line 442, in _iterencode
o = _default(o)
File
"/usr/lib64/python2.7/json/encoder.py", line 184, in default
raise TypeError(repr(o) + " is not
JSON serializable")
TypeError: <coprs.models.User object at
0x7f7544056a90> is not JSON serializable
Signed-off-by: Igor Gnatenko <i.gnatenko.brain(a)gmail.com>
>---------------------------------------------------------------
.../coprs/views/api_ns/api_general.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
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 8334776..417b7fb 100644
--- a/frontend/coprs_frontend/coprs/views/api_ns/api_general.py
+++ b/frontend/coprs_frontend/coprs/views/api_ns/api_general.py
@@ -414,7 +414,7 @@ def api_coprs_search_by_project(project=None):
repos = query.all()
output = {"output": "ok", "repos": []}
for repo in repos:
- output["repos"].append({"username": repo.owner,
+ output["repos"].append({"username": repo.owner.name,
"coprname": repo.name,
"description": repo.description})
else:
10 years
[copr] master: [java] Add authentication (da73f77)
by Mikolaj Izdebski
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit da73f776ae5a373259908267ddc69a348a958abf
Author: Mikolaj Izdebski <mizdebsk(a)redhat.com>
Date: Fri Mar 21 15:36:22 2014 +0100
[java] Add authentication
>---------------------------------------------------------------
.../copr/client/impl/BuildCommand.java | 6 ++++
.../fedoraproject/copr/client/impl/RpcCommand.java | 25 ++++++++++++++++++++
.../fedoraproject/copr/client/impl/BuildTest.java | 12 +++++++++
.../fedoraproject/copr/client/impl/RpcTest.java | 7 ++++-
4 files changed, 49 insertions(+), 1 deletions(-)
diff --git a/java/copr-impl/src/main/java/org/fedoraproject/copr/client/impl/BuildCommand.java b/java/copr-impl/src/main/java/org/fedoraproject/copr/client/impl/BuildCommand.java
index 60fd8ff..5e1c7e7 100644
--- a/java/copr-impl/src/main/java/org/fedoraproject/copr/client/impl/BuildCommand.java
+++ b/java/copr-impl/src/main/java/org/fedoraproject/copr/client/impl/BuildCommand.java
@@ -37,6 +37,12 @@ public class BuildCommand
}
@Override
+ protected boolean requiresAuthentication()
+ {
+ return true;
+ }
+
+ @Override
protected String getCommandUrl()
{
return "/api/coprs/" + request.getUserName() + "/" + request.getProjectName() + "/new_build/";
diff --git a/java/copr-impl/src/main/java/org/fedoraproject/copr/client/impl/RpcCommand.java b/java/copr-impl/src/main/java/org/fedoraproject/copr/client/impl/RpcCommand.java
index f75e208..2314a6a 100644
--- a/java/copr-impl/src/main/java/org/fedoraproject/copr/client/impl/RpcCommand.java
+++ b/java/copr-impl/src/main/java/org/fedoraproject/copr/client/impl/RpcCommand.java
@@ -21,11 +21,14 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.HttpURLConnection;
+import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+import javax.xml.bind.DatatypeConverter;
+
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
@@ -50,6 +53,11 @@ public abstract class RpcCommand<T>
protected abstract T parseResponse( JsonObject response );
+ protected boolean requiresAuthentication()
+ {
+ return false;
+ }
+
public T execute( DefaultCoprSession session )
throws CoprException
{
@@ -80,6 +88,23 @@ public abstract class RpcCommand<T>
post.setEntity( new UrlEncodedFormEntity( nameValuePairs ) );
}
+ if ( requiresAuthentication() )
+ {
+ String login = session.getConfiguration().getLogin();
+ if ( login == null || login.isEmpty() )
+ throw new CoprException( "Authentification is required to perform this command "
+ + "but no login was provided in configuration" );
+
+ String token = session.getConfiguration().getToken();
+ if ( token == null || token.isEmpty() )
+ throw new CoprException( "Authentification is required to perform this command "
+ + "but no login was provided in configuration" );
+
+ String auth = login + ":" + token;
+ String encodedAuth = DatatypeConverter.printBase64Binary( auth.getBytes( StandardCharsets.UTF_8 ) );
+ request.setHeader( "Authorization", "Basic " + encodedAuth );
+ }
+
request.addHeader( "Accept", APPLICATION_JSON.getMimeType() );
HttpResponse response = client.execute( request );
diff --git a/java/copr-impl/src/test/java/org/fedoraproject/copr/client/impl/BuildTest.java b/java/copr-impl/src/test/java/org/fedoraproject/copr/client/impl/BuildTest.java
index 643dd02..1e97df9 100644
--- a/java/copr-impl/src/test/java/org/fedoraproject/copr/client/impl/BuildTest.java
+++ b/java/copr-impl/src/test/java/org/fedoraproject/copr/client/impl/BuildTest.java
@@ -24,6 +24,7 @@ import static org.junit.Assert.fail;
import org.easymock.EasyMockRunner;
import org.fedoraproject.copr.client.BuildRequest;
import org.fedoraproject.copr.client.BuildResult;
+import org.fedoraproject.copr.client.CoprConfiguration;
import org.fedoraproject.copr.client.CoprException;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,6 +33,17 @@ import org.junit.runner.RunWith;
public class BuildTest
extends RpcTest
{
+ @Override
+ protected CoprConfiguration getConfiguration()
+ {
+ CoprConfiguration config = super.getConfiguration();
+
+ config.setLogin( "test-login" );
+ config.setToken( "p4s5w0rd" );
+
+ return config;
+ }
+
@Test
public void testBuild()
throws Exception
diff --git a/java/copr-impl/src/test/java/org/fedoraproject/copr/client/impl/RpcTest.java b/java/copr-impl/src/test/java/org/fedoraproject/copr/client/impl/RpcTest.java
index 2cf5abd..2c4463f 100644
--- a/java/copr-impl/src/test/java/org/fedoraproject/copr/client/impl/RpcTest.java
+++ b/java/copr-impl/src/test/java/org/fedoraproject/copr/client/impl/RpcTest.java
@@ -46,6 +46,11 @@ public abstract class RpcTest
return mock;
}
+ protected CoprConfiguration getConfiguration()
+ {
+ return new CoprConfiguration();
+ }
+
@Before
public void setUp()
throws Exception
@@ -57,7 +62,7 @@ public abstract class RpcTest
InetSocketAddress address = server.getServiceAddress();
url = "http://" + address.getHostName() + ":" + address.getPort();
- CoprConfiguration configuration = new CoprConfiguration();
+ CoprConfiguration configuration = getConfiguration();
configuration.setUrl( url );
CoprService copr = new DefaultCoprService();
10 years
[copr] master: [java] Fix API URL for build command (680e66f)
by Mikolaj Izdebski
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 680e66f52a3ea066d3431b571c5026e4169ea6d3
Author: Mikolaj Izdebski <mizdebsk(a)redhat.com>
Date: Fri Mar 21 15:35:38 2014 +0100
[java] Fix API URL for build command
>---------------------------------------------------------------
.../copr/client/impl/BuildCommand.java | 2 +-
.../fedoraproject/copr/client/impl/BuildTest.java | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/java/copr-impl/src/main/java/org/fedoraproject/copr/client/impl/BuildCommand.java b/java/copr-impl/src/main/java/org/fedoraproject/copr/client/impl/BuildCommand.java
index e509265..60fd8ff 100644
--- a/java/copr-impl/src/main/java/org/fedoraproject/copr/client/impl/BuildCommand.java
+++ b/java/copr-impl/src/main/java/org/fedoraproject/copr/client/impl/BuildCommand.java
@@ -39,7 +39,7 @@ public class BuildCommand
@Override
protected String getCommandUrl()
{
- return "/api/copr/" + request.getUserName() + "/" + request.getProjectName() + "/new_build/";
+ return "/api/coprs/" + request.getUserName() + "/" + request.getProjectName() + "/new_build/";
}
@Override
diff --git a/java/copr-impl/src/test/java/org/fedoraproject/copr/client/impl/BuildTest.java b/java/copr-impl/src/test/java/org/fedoraproject/copr/client/impl/BuildTest.java
index a202f58..643dd02 100644
--- a/java/copr-impl/src/test/java/org/fedoraproject/copr/client/impl/BuildTest.java
+++ b/java/copr-impl/src/test/java/org/fedoraproject/copr/client/impl/BuildTest.java
@@ -36,7 +36,7 @@ public class BuildTest
public void testBuild()
throws Exception
{
- expect( mock.post( "/api/copr/john/toy/new_build/" ) ).andReturn( "build1" );
+ expect( mock.post( "/api/coprs/john/toy/new_build/" ) ).andReturn( "build1" );
replay( mock );
BuildRequest request = new BuildRequest( "john", "toy" );
@@ -54,7 +54,7 @@ public class BuildTest
public void testBuildFail()
throws Exception
{
- expect( mock.post( "/api/copr/john/toy/new_build/" ) ).andReturn( "fail" );
+ expect( mock.post( "/api/coprs/john/toy/new_build/" ) ).andReturn( "fail" );
replay( mock );
BuildRequest request = new BuildRequest( "john", "toy" );
10 years
[copr] master: status page fix: long time (c70aeff)
by asamalik@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit c70aeffe998c9400c34550998f87102f537b6261
Author: Adam Samalik <asamalik(a)redhat.com>
Date: Fri Mar 21 13:03:28 2014 +0100
status page fix: long time
>---------------------------------------------------------------
frontend/coprs_frontend/coprs/filters.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/frontend/coprs_frontend/coprs/filters.py b/frontend/coprs_frontend/coprs/filters.py
index d079123..2153240 100644
--- a/frontend/coprs_frontend/coprs/filters.py
+++ b/frontend/coprs_frontend/coprs/filters.py
@@ -62,13 +62,13 @@ def time_ago(time_in):
"""
now = datetime.datetime.now()
diff = now - datetime.datetime.fromtimestamp(time_in)
- secdiff = diff.seconds
+ secdiff = int(diff.total_seconds())
if secdiff < 120:
return "1 minute"
elif secdiff < 7200:
return str(secdiff/60) + " minutes"
else:
- return str(secdiff/3600) + "hours"
+ return str(secdiff/3600) + " hours"
@app.template_filter("markdown")
10 years
[copr] master: status page fix: project's owner (eae08da)
by asamalik@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit eae08da2d11a9e9b31ecda2079bb9c33255bb1b1
Author: Adam Samalik <asamalik(a)redhat.com>
Date: Fri Mar 21 10:58:11 2014 +0100
status page fix: project's owner
>---------------------------------------------------------------
.../coprs/views/status_ns/status_general.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/frontend/coprs_frontend/coprs/views/status_ns/status_general.py b/frontend/coprs_frontend/coprs/views/status_ns/status_general.py
index eaa0607..03a5c65 100644
--- a/frontend/coprs_frontend/coprs/views/status_ns/status_general.py
+++ b/frontend/coprs_frontend/coprs/views/status_ns/status_general.py
@@ -17,7 +17,7 @@ def status_home():
build_dict = {
'chroot' : chroot.name,
'time' : build.submitted_on,
- 'owner' : build.user.name,
+ 'owner' : build.copr.owner.name,
'pkgs' : pkgs,
'copr' : build.copr.name}
builds_list.append(build_dict)
10 years
[copr] master: copr-cli waiting fix (c57f2e7)
by asamalik@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit c57f2e769d2a697889c54ca6aaea3ff41e4c0370
Author: Adam Samalik <asamalik(a)redhat.com>
Date: Fri Mar 21 10:44:56 2014 +0100
copr-cli waiting fix
>---------------------------------------------------------------
cli/copr_cli/subcommands.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cli/copr_cli/subcommands.py b/cli/copr_cli/subcommands.py
index e83d474..2bf0f34 100644
--- a/cli/copr_cli/subcommands.py
+++ b/cli/copr_cli/subcommands.py
@@ -259,7 +259,7 @@ def build(copr, pkgs, memory, timeout, wait=True, result=None):
print("{0} Build {2}: {1}".format(now.strftime("%H:%M:%S"), status, id))
prevstatus[id] = status
- if status in ["succeeded", "failed"]:
+ if status in ["succeeded", "failed", "canceled"]:
if result is not None:
result[id]['status'] = status
output["ids"].remove(id)
10 years