Commit 1452f8c4 authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

Merge branch 'latest-quota' of https://code.grnet.gr/git/synnefo into latest-quota

parents fd341fda 5a0f5302
......@@ -178,6 +178,7 @@ UNKNOWN_IDENTIFIER = 'Unknown identifier.'
PENDING_MEMBERSHIP_LEAVE = 'Your request is pending moderation by the Project owner.'
USER_JOINED_PROJECT = '%(realname)s has joined the Project.'
USER_LEFT_PROJECT = '%(realname)s has left the Project.'
USER_JOIN_REQUEST_SUBMITED = 'Join request submitted.'
# Auth providers messages
AUTH_PROVIDER_NOT_ACTIVE = "'%(provider)s' is disabled."
......
......@@ -244,6 +244,7 @@ class UserProjectApplicationsTable(UserTable):
def member_action_extra_context(membership, table, col):
context = []
urls, actions, prompts, confirms = [], [], [], []
if membership.state == ProjectMembership.REQUESTED:
urls = ['astakos.im.views.project_reject_member',
......
......@@ -1189,12 +1189,15 @@ def project_search(request):
def project_join(request, application_id):
next = request.GET.get('next')
if not next:
next = reverse('astakos.im.views.project_list')
next = reverse('astakos.im.views.project_detail',
args=(application_id,))
rollback = False
try:
application_id = int(application_id)
join_project(application_id, request.user)
# TODO: distinct messages for request/auto accept ???
messages.success(request, _(astakos_messages.USER_JOIN_REQUEST_SUBMITED))
except (IOError, PermissionDenied), e:
messages.error(request, e)
except BaseException, e:
......@@ -1237,7 +1240,7 @@ def project_leave(request, application_id):
next = restrict_next(next, domain=COOKIE_DOMAIN)
return redirect(next)
@require_http_methods(["GET"])
@require_http_methods(["POST"])
@signed_terms_required
@login_required
@transaction.commit_manually
......
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