Revision a75dbd7b snf-astakos-app/astakos/im/views.py
b/snf-astakos-app/astakos/im/views.py | ||
---|---|---|
98 | 98 |
SendNotificationError, |
99 | 99 |
accept_membership, reject_membership, remove_membership, cancel_membership, |
100 | 100 |
leave_project, join_project, enroll_member, can_join_request, can_leave_request, |
101 |
cancel_application, get_related_project_id, |
|
101 | 102 |
get_by_chain_or_404) |
102 | 103 |
from astakos.im.settings import ( |
103 | 104 |
COOKIE_DOMAIN, LOGOUT_NEXT, |
... | ... | |
1100 | 1101 |
@require_http_methods(["GET", "POST"]) |
1101 | 1102 |
@signed_terms_required |
1102 | 1103 |
@login_required |
1104 |
@project_transaction_context() |
|
1105 |
def project_app_cancel(request, application_id, ctx=None): |
|
1106 |
chain_id = None |
|
1107 |
try: |
|
1108 |
application_id = int(application_id) |
|
1109 |
chain_id = get_related_project_id(application_id) |
|
1110 |
cancel_application(application_id, request.user) |
|
1111 |
except (IOError, PermissionDenied), e: |
|
1112 |
messages.error(request, e) |
|
1113 |
except BaseException, e: |
|
1114 |
logger.exception(e) |
|
1115 |
messages.error(request, _(astakos_messages.GENERIC_ERROR)) |
|
1116 |
if ctx: |
|
1117 |
ctx.mark_rollback() |
|
1118 |
else: |
|
1119 |
msg = _(astakos_messages.APPLICATION_CANCELLED) |
|
1120 |
messages.success(request, msg) |
|
1121 |
|
|
1122 |
next = request.GET.get('next') |
|
1123 |
if not next: |
|
1124 |
if chain_id: |
|
1125 |
next = reverse('astakos.im.views.project_detail', args=(chain_id,)) |
|
1126 |
else: |
|
1127 |
next = reverse('astakos.im.views.project_list') |
|
1128 |
|
|
1129 |
next = restrict_next(next, domain=COOKIE_DOMAIN) |
|
1130 |
return redirect(next) |
|
1131 |
|
|
1132 |
|
|
1133 |
@require_http_methods(["GET", "POST"]) |
|
1134 |
@signed_terms_required |
|
1135 |
@login_required |
|
1103 | 1136 |
def project_modify(request, application_id): |
1104 | 1137 |
|
1105 | 1138 |
try: |
Also available in: Unified diff