Skip to content

Commit 0861d24

Browse files
author
Frank Duncan
committed
Add ENABLE_SUBMISSION_WITHDRAWAL to allow enabling withdrawals
This only affects about enabling them, not whether they are in the system. That means that if the configuration is changed over the lifetime of a system, things that were withdrawn when it was enabled retain that status.
1 parent 618d685 commit 0861d24

File tree

5 files changed

+12
-1
lines changed

5 files changed

+12
-1
lines changed

docs/setup/administrators/configuration.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ The corrosponding locale dir is named: en, en_GB, en_US
7676

7777
FORCE_LOGIN_FOR_APPLICATION = env.bool('FORCE_LOGIN_FOR_APPLICATION', False)
7878

79+
### Allow Withdrawing of Submissions
80+
81+
ENABLE_SUBMISSION_WITHDRAWAL = env.bool('ENABLE_SUBMISSION_WITHDRAWAL', False)
82+
7983
### Set the allowed file extension for all uploads fields.
8084

8185
FILE_ALLOWED_EXTENSIONS = ['doc', 'docx', 'odp', 'ods', 'odt', 'pdf', 'ppt', 'pptx', 'rtf', 'txt', 'xls', 'xlsx']

hypha/apply/funds/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,6 +1405,9 @@ def post(self, request, *args, **kwargs):
14051405
return self.withdraw(request, *args, **kwargs)
14061406

14071407
def withdraw(self, request, *args, **kwargs):
1408+
if not settings.ENABLE_SUBMISSION_WITHDRAWAL:
1409+
raise PermissionDenied
1410+
14081411
obj = self.get_object()
14091412

14101413
if not obj.phase.permissions.can_edit(request.user):

hypha/apply/funds/workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def make_permissions(edit=None, review=None, view=None):
348348
'display': _('Need screening'),
349349
'public': _('Application Received'),
350350
'stage': RequestExt,
351-
'permissions': default_permissions,
351+
'permissions': applicant_edit_permissions,
352352
},
353353
'ext_more_info': {
354354
'transitions': {

hypha/public/utils/context_processors.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ def global_vars(request):
1818
'ORG_URL': settings.ORG_URL,
1919
'CURRENCY_SYMBOL': settings.CURRENCY_SYMBOL,
2020
'GOOGLE_OAUTH2': settings.SOCIAL_AUTH_GOOGLE_OAUTH2_KEY,
21+
'ENABLE_SUBMISSION_WITHDRAWAL': settings.ENABLE_SUBMISSION_WITHDRAWAL,
2122
'ENABLE_REGISTRATION_WITHOUT_APPLICATION': settings.ENABLE_REGISTRATION_WITHOUT_APPLICATION,
2223
}

hypha/settings/base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@
106106
# Enable users to create accounts without submitting an application.
107107
ENABLE_REGISTRATION_WITHOUT_APPLICATION = env.bool('ENABLE_REGISTRATION_WITHOUT_APPLICATION', False)
108108

109+
# Allow Withdrawing of Submissions
110+
ENABLE_SUBMISSION_WITHDRAWAL = env.bool('ENABLE_SUBMISSION_WITHDRAWAL', False)
111+
109112
# Project settings.
110113

111114
# SECRET_KEY is required

0 commit comments

Comments
 (0)