Repository :
http://git.fedorahosted.org/cgit/copr.git
On branch : master
---------------------------------------------------------------
commit 81bc7c5b7f57ad50eb03be98359e78b4c84d49b5
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Thu Sep 3 13:42:49 2015 +0200
[frontend][API] added read-only field `result_dir_url` to BuildChroot resource
---------------------------------------------------------------
frontend/coprs_frontend/coprs/models.py | 6 ++++++
frontend/coprs_frontend/coprs/rest_api/schemas.py | 2 ++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/frontend/coprs_frontend/coprs/models.py
b/frontend/coprs_frontend/coprs/models.py
index 945d9e2..c423ef3 100644
--- a/frontend/coprs_frontend/coprs/models.py
+++ b/frontend/coprs_frontend/coprs/models.py
@@ -692,6 +692,12 @@ class BuildChroot(db.Model, helpers.Serializer):
return None
@property
+ def result_dir_url(self):
+ return "/".join([app.config["BACKEND_BASE_URL"],
+ u"results",
+ self.result_dir])
+
+ @property
def result_dir(self):
# hide changes occurred after migration to dist-git
# if build has defined dist-git, it means that new schema should be used
diff --git a/frontend/coprs_frontend/coprs/rest_api/schemas.py
b/frontend/coprs_frontend/coprs/rest_api/schemas.py
index cc2b446..4af3e2c 100644
--- a/frontend/coprs_frontend/coprs/rest_api/schemas.py
+++ b/frontend/coprs_frontend/coprs/rest_api/schemas.py
@@ -113,6 +113,7 @@ class BuildChrootSchema(Schema):
git_hash = fields.Str(dump_only=True)
name = fields.Str(dump_only=True)
+ result_dir_url = fields.Str(dump_only=True)
class BuildSchema(Schema):
@@ -129,6 +130,7 @@ class BuildSchema(Schema):
ended_on = fields.Int(dump_only=True)
results = fields.Str(dump_only=True)
+
timeout = fields.Int(dump_only=True)
enable_net = fields.Bool(dump_only=True)