Revision e872c133 snf-astakos-app/astakos/im/functions.py
b/snf-astakos-app/astakos/im/functions.py | ||
---|---|---|
52 | 52 |
membership_enroll_notify, membership_request_notify, \ |
53 | 53 |
membership_leave_request_notify, application_submit_notify, \ |
54 | 54 |
application_approve_notify, application_deny_notify, \ |
55 |
project_termination_notify, project_suspension_notify |
|
55 |
project_termination_notify, project_suspension_notify, \ |
|
56 |
project_unsuspension_notify, project_reinstatement_notify |
|
56 | 57 |
from astakos.im import settings |
57 | 58 |
|
58 | 59 |
import astakos.im.messages as astakos_messages |
... | ... | |
893 | 894 |
project_suspension_notify(project) |
894 | 895 |
|
895 | 896 |
|
896 |
def resume(project_id, request_user=None, reason=None):
|
|
897 |
def unsuspend(project_id, request_user=None, reason=None):
|
|
897 | 898 |
project = get_project_for_update(project_id) |
898 | 899 |
project_check_allowed(project, request_user, level=ADMIN_LEVEL) |
899 | 900 |
|
... | ... | |
904 | 905 |
project.resume(actor=request_user, reason=reason) |
905 | 906 |
qh_sync_project(project) |
906 | 907 |
logger.info("%s has been unsuspended." % (project)) |
908 |
project_unsuspension_notify(project) |
|
909 |
|
|
910 |
|
|
911 |
def reinstate(project_id, request_user=None, reason=None): |
|
912 |
get_project_lock() |
|
913 |
project = get_project_for_update(project_id) |
|
914 |
project_check_allowed(project, request_user, level=ADMIN_LEVEL) |
|
915 |
|
|
916 |
if not project.is_terminated: |
|
917 |
m = _(astakos_messages.NOT_TERMINATED_PROJECT) % project.id |
|
918 |
raise ProjectConflict(m) |
|
919 |
|
|
920 |
check_conflicting_projects(project.application) |
|
921 |
project.resume(actor=request_user, reason=reason) |
|
922 |
qh_sync_project(project) |
|
923 |
logger.info("%s has been reinstated" % (project)) |
|
924 |
project_reinstatement_notify(project) |
|
907 | 925 |
|
908 | 926 |
|
909 | 927 |
def _partition_by(f, l): |
Also available in: Unified diff