[copr] master: Format legal-action action type properly (ffe9afa)

bkabrda at fedoraproject.org bkabrda at fedoraproject.org
Tue Apr 2 10:36:12 UTC 2013


Repository : http://git.fedorahosted.org/cgit/copr.git

On branch  : master

>---------------------------------------------------------------

commit ffe9afaa2c36b3e7be25554978f51e14afe3737f
Author: Bohuslav Kabrda <bkabrda at redhat.com>
Date:   Tue Apr 2 11:30:46 2013 +0200

    Format legal-action action type properly
    
    - fix formatting of any action by using values from ActionTypeEnum


>---------------------------------------------------------------

 coprs_frontend/coprs/models.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/coprs_frontend/coprs/models.py b/coprs_frontend/coprs/models.py
index c092e53..3beac64 100644
--- a/coprs_frontend/coprs/models.py
+++ b/coprs_frontend/coprs/models.py
@@ -293,12 +293,14 @@ class Action(db.Model, Serializer):
         return self.__unicode__()
 
     def __unicode__(self):
-        if self.action_type == 'delete':
+        if self.action_type == helpers.ActionTypeEnum('delete'):
             return 'Deleting {0} {1}'.format(self.object_type, self.old_value)
-        elif self.action_type == 'rename':
+        elif self.action_type == helpers.ActionTypeEnum('rename'):
             return 'Renaming {0} from {1} to {2}.'.format(self.object_type,
                                                           self.old_value,
                                                           self.new_value)
+        elif self.action_type == helpers.ActionTypeEnum('legal-flag'):
+            return 'Legal flag on copr {0}.'.format(self.old_value)
 
         return 'Action {0} on {1}, old value: {2}, new value: {3}.'.format(self.action_type,
                                                                            self.object_type,



More information about the copr-devel mailing list