Revision db472f3d snf-astakos-app/astakos/im/functions.py
b/snf-astakos-app/astakos/im/functions.py | ||
---|---|---|
692 | 692 |
m = _(astakos_messages.NOT_ALLOWED) |
693 | 693 |
raise PermissionDenied(m) |
694 | 694 |
|
695 |
reached, limit = reached_pending_application_limit(request_user.id, precursor) |
|
696 |
if reached: |
|
695 |
owner = kw['owner'] |
|
696 |
reached, limit = reached_pending_application_limit(owner.id, precursor) |
|
697 |
if not request_user.is_project_admin() and reached: |
|
697 | 698 |
m = _(astakos_messages.REACHED_PENDING_APPLICATION_LIMIT) % limit |
698 | 699 |
raise PermissionDenied(m) |
699 | 700 |
|
... | ... | |
860 | 861 |
|
861 | 862 |
PENDING = ProjectApplication.PENDING |
862 | 863 |
pending = ProjectApplication.objects.filter( |
863 |
applicant__id=user_id, state=PENDING).count()
|
|
864 |
owner__id=user_id, state=PENDING).count()
|
|
864 | 865 |
|
865 | 866 |
return pending >= limit, limit |
866 | 867 |
|
Also available in: Unified diff