Fixed a cleaning bug which allowed a proposal to be recreated by the original proposer.
authorLennard de Rijk <ljvderijk@gmail.com>
Sun, 08 Mar 2009 19:12:17 +0000
changeset 1755 972c546f0810
parent 1754 63fa0e7f8f47
child 1756 0a332ff872bf
Fixed a cleaning bug which allowed a proposal to be recreated by the original proposer. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed
app/soc/logic/cleaning.py
--- a/app/soc/logic/cleaning.py	Sun Mar 08 18:09:04 2009 +0000
+++ b/app/soc/logic/cleaning.py	Sun Mar 08 19:12:17 2009 +0000
@@ -463,9 +463,10 @@
       # get the current user
       user_entity = user_logic.getForCurrentAccount()
 
-      # make sure it's not the applicant creating the new group
-      if group_app_entity and (
-          group_app_entity.applicant.key() != user_entity.key()):
+      # if the proposal has not been accepted or it's not the applicant
+      # creating the new group then show link ID in use message
+      if group_app_entity and (group_app_entity.status != 'accepted' or (
+          group_app_entity.applicant.key() != user_entity.key())):
         # add the error message to the link id field
         self._errors[link_id_field] = ErrorList([DEF_LINK_ID_IN_USE_MSG])
         del cleaned_data[link_id_field]