damned-lies r1398 - in trunk: . vertimus



Author: claudep
Date: Mon Jan 26 18:33:00 2009
New Revision: 1398
URL: http://svn.gnome.org/viewvc/damned-lies?rev=1398&view=rev

Log:
2009-01-26  Claude Paroz  <claude 2xlibre net>

	* vertimus/forms.py: Verify that no file is sent for 'Reserve' actions.
	* vertimus/models.py: Add file_is_prohibited = True for 'Reserve' actions.

Modified:
   trunk/ChangeLog
   trunk/vertimus/forms.py
   trunk/vertimus/models.py

Modified: trunk/vertimus/forms.py
==============================================================================
--- trunk/vertimus/forms.py	(original)
+++ trunk/vertimus/forms.py	Mon Jan 26 18:33:00 2009
@@ -66,6 +66,9 @@
 
         if action.file_is_required and not file:
             raise forms.ValidationError(_("A file is needed for this action."))
+        
+        if action.file_is_prohibited and file:
+            raise forms.ValidationError(_("Please, don't send a file with a 'Reserve' action."))
 
         return cleaned_data
         

Modified: trunk/vertimus/models.py
==============================================================================
--- trunk/vertimus/models.py	(original)
+++ trunk/vertimus/models.py	Mon Jan 26 18:33:00 2009
@@ -326,7 +326,7 @@
             return []
 
     def __unicode__(self):
-        return self.name
+        return "%s (%s)" % (self.name, self.id)
     
 
 class ActionAbstract(object):
@@ -335,6 +335,7 @@
     # A comment or a file is required
     arg_is_required = False
     file_is_required = False
+    file_is_prohibited = False
     
     @classmethod
     def new_by_name(cls, action_name):
@@ -489,6 +490,7 @@
 class ActionRT(ActionAbstract):
     name = 'RT'
     description = _('Reserve for translation')
+    file_is_prohibited = True
 
     def _new_state(self):
         return StateTranslating()
@@ -515,6 +517,7 @@
 class ActionRP(ActionAbstract):
     name = 'RP'
     description = _('Reserve for proofreading')
+    file_is_prohibited = True
 
     def _new_state(self):
         return StateProofreading()
@@ -559,6 +562,7 @@
     name = 'RC'
     # Translators: this indicates a committer is going to commit the file in the repository
     description = _('Reserve to submit')
+    file_is_prohibited = True
 
     def _new_state(self):
         return StateCommitting()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]