Commit c7c541c9 authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

Do not allow user whose project acceptation is

pending to leave the project.
parent feb4f6a5
...@@ -154,19 +154,23 @@ def action_extra_context(project, table, self): ...@@ -154,19 +154,23 @@ def action_extra_context(project, table, self):
action = _('Update') action = _('Update')
confirm = False confirm = False
prompt = '' prompt = ''
elif user.is_project_member(project): elif user.is_project_accepted_member(project):
url = 'astakos.im.views.project_leave' url = 'astakos.im.views.project_leave'
action = _('- Leave') action = _('- Leave')
confirm = True confirm = True
prompt = _('Are you sure you want to leave from the project ?') prompt = _('Are you sure you want to leave from the project ?')
else: elif not user.is_project_member(project):
url = 'astakos.im.views.project_join' url = 'astakos.im.views.project_join'
action = _('+ Join') action = _('+ Join')
confirm = True confirm = True
prompt = _('Are you sure you want to join this project ?') prompt = _('Are you sure you want to join this project ?')
else:
action = _('Pending')
return {'action': action, 'confirm': confirm, url = reverse(url, args=(project.pk, )) + append_url if url else ''
'url': reverse(url, args=(project.pk, )) + append_url, return {'action': action,
'confirm': confirm,
'url': url,
'prompt': prompt} 'prompt': prompt}
......
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