Commit 64bbce39 authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

Change join/leave project policies

parent e791bbfc
......@@ -763,8 +763,14 @@ class ProjectApplicationForm(forms.ModelForm):
'limit_on_members_number')
def __init__(self, *args, **kwargs):
self.precursor_application = kwargs.get('instance')
instance = kwargs.get('instance')
self.precursor_application = instance
super(ProjectApplicationForm, self).__init__(*args, **kwargs)
if not instance:
# remove closed join policy
policies = PROJECT_MEMBER_JOIN_POLICIES.copy()
policies.pop('3')
self.fields['member_join_policy'].choices = policies.iteritems()
def clean_start_date(self):
start_date = self.cleaned_data.get('start_date')
......
......@@ -307,12 +307,12 @@ SHIBBOLETH_REQUIRE_NAME_INFO = getattr(settings,
PROJECT_MEMBER_JOIN_POLICIES = getattr(settings,
'ASTAKOS_PROJECT_MEMBER_JOIN_POLICIES',
{'1':'automatically accepted by the system',
'2':'accepted by the owner of the project',
'3':'members can not join the project'})
{'1':'automatically accepted',
'2':'owner accepts',
'3':'closed'})
PROJECT_MEMBER_LEAVE_POLICIES = getattr(settings,
'ASTAKOS_PROJECT_MEMBER_LEAVE_POLICIES',
{'1':'automatically accepted by the system',
'2':'accepted by the owner of the project',
'3':'members can not leave the project'})
{'1':'automatically accepted',
'2':'owner accepts',
'3':'closed'})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment