app/soc/logic/cleaning.py
changeset 1085 0afbdd0905ef
parent 1083 b8018d7a9f23
child 1088 7ad48d59da3d
equal deleted inserted replaced
1084:9c4221f7b747 1085:0afbdd0905ef
   197       # validate the link_id
   197       # validate the link_id
   198       club_link_id = clean_link_id(field_name)(self)
   198       club_link_id = clean_link_id(field_name)(self)
   199 
   199 
   200       # check if there is already an application with the given link_id
   200       # check if there is already an application with the given link_id
   201       fields = {'link_id': club_link_id,
   201       fields = {'link_id': club_link_id,
   202                 'state': ['accepted','ignored','needs review','completed']}
   202                 'status': ['accepted','ignored','needs review','completed']}
   203       club_app_entity = club_app_logic.logic.getForFields(fields, unique=True)
   203       club_app_entity = club_app_logic.logic.getForFields(fields, unique=True)
   204 
   204 
   205       if club_app_entity:
   205       if club_app_entity:
   206         raise forms.ValidationError(
   206         raise forms.ValidationError(
   207             ugettext('This link ID is already in use, please specify another one'))
   207             ugettext('This link ID is already in use, please specify another one'))
   208 
   208 
   209       # check if there is already a club with the given link_id
   209       # check if there is already a club with the given link_id
   210       fields['state'] = ['new', 'active', 'inactive']
   210       fields['status'] = ['new', 'active', 'inactive']
   211       club_entity = club_logic.logic.getForFields(fields, unique=True)
   211       club_entity = club_logic.logic.getForFields(fields, unique=True)
   212 
   212 
   213       if club_entity:
   213       if club_entity:
   214         raise forms.ValidationError(
   214         raise forms.ValidationError(
   215             ugettext('This link ID is already in use, please specify another one'))
   215             ugettext('This link ID is already in use, please specify another one'))