Repository :
http://git.fedorahosted.org/cgit/copr.git
On branch : master
---------------------------------------------------------------
commit a3a7619dd581eb0869f9920a03993616d8271937
Author: Adam Samalik <asamalik(a)redhat.com>
Date: Thu Sep 10 17:13:02 2015 +0200
[API 2] add build submitter
---------------------------------------------------------------
frontend/coprs_frontend/coprs/models.py | 4 ++++
frontend/coprs_frontend/coprs/rest_api/schemas.py | 2 ++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/frontend/coprs_frontend/coprs/models.py
b/frontend/coprs_frontend/coprs/models.py
index e52087c..63ef2bd 100644
--- a/frontend/coprs_frontend/coprs/models.py
+++ b/frontend/coprs_frontend/coprs/models.py
@@ -370,6 +370,10 @@ class Build(db.Model, helpers.Serializer):
chroots = association_proxy("build_chroots", "mock_chroot")
@property
+ def user_name(self):
+ return self.user.name
+
+ @property
def fail_type_text(self):
return helpers.FailTypeEnum(self.fail_type)
diff --git a/frontend/coprs_frontend/coprs/rest_api/schemas.py
b/frontend/coprs_frontend/coprs/rest_api/schemas.py
index b28d1c6..2144b54 100644
--- a/frontend/coprs_frontend/coprs/rest_api/schemas.py
+++ b/frontend/coprs_frontend/coprs/rest_api/schemas.py
@@ -145,6 +145,8 @@ class BuildSchema(Schema):
id = fields.Int(dump_only=True)
state = fields.Str()
+ submitter = fields.Str(dump_only=True, attribute="user_name")
+
built_packages = BuiltPackages(dump_only=True)
package_version = fields.Str(dump_only=True, attribute="pkg_version")
package_name = fields.Str(dump_only=True)