Revision c7c0ec58 snf-astakos-app/astakos/im/views.py

b/snf-astakos-app/astakos/im/views.py
99 99
    invite,
100 100
    send_activation as send_activation_func,
101 101
    SendNotificationError,
102
    reached_pending_application_limit,
102 103
    accept_membership, reject_membership, remove_membership, cancel_membership,
103 104
    leave_project, join_project, enroll_member, can_join_request, can_leave_request,
104 105
    get_related_project_id, get_by_chain_or_404,
......
1045 1046
@signed_terms_required
1046 1047
@login_required
1047 1048
def project_add(request):
1049

  
1050
    user = request.user
1051
    reached, limit = reached_pending_application_limit(user.id)
1052
    if reached:
1053
        m = _(astakos_messages.PENDING_APPLICATION_LIMIT_ADD) % limit
1054
        messages.error(request, m)
1055
        next = reverse('astakos.im.views.project_list')
1056
        next = restrict_next(next, domain=COOKIE_DOMAIN)
1057
        return redirect(next)
1058

  
1048 1059
    resource_groups = RESOURCES_PRESENTATION_DATA.get('groups', {})
1049 1060
    resource_catalog = ()
1050 1061
    result = callpoint.list_resources()
......
1157 1168
        m = _(astakos_messages.NOT_ALLOWED)
1158 1169
        raise PermissionDenied(m)
1159 1170

  
1171
    reached, limit = reached_pending_application_limit(user.id, app)
1172
    if reached:
1173
        m = _(astakos_messages.PENDING_APPLICATION_LIMIT_MODIFY) % limit
1174
        messages.error(request, m)
1175
        next = reverse('astakos.im.views.project_list')
1176
        next = restrict_next(next, domain=COOKIE_DOMAIN)
1177
        return redirect(next)
1178

  
1160 1179
    resource_groups = RESOURCES_PRESENTATION_DATA.get('groups', {})
1161 1180
    resource_catalog = ()
1162 1181
    result = callpoint.list_resources()

Also available in: Unified diff