Skip to content

Commit cacfc93

Browse files
committed
Clean up from cherry-pick/rebase
Removed a redeclared variable and reformatted. Issue #3296
1 parent 307ddd4 commit cacfc93

File tree

5 files changed

+30
-23
lines changed

5 files changed

+30
-23
lines changed

hypha/apply/funds/templates/funds/applicationsubmission_confirm_withdraw.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
{% block title %}{% trans "Withdrawing" %}: {{object.title }}{% endblock %}
55

66
{% block content %}
7-
<div class="admin-bar">
8-
<div class="admin-bar__inner">
9-
<h2 class="heading heading--no-margin">{% trans "Withdrawing" %}: {{ object.title }}</h2>
7+
<div class="admin-bar">
8+
<div class="admin-bar__inner">
9+
<h2 class="heading heading--no-margin">{% trans "Withdrawing" %}: {{ object.title }}</h2>
10+
</div>
1011
</div>
11-
</div>
1212

13-
<div class="wrapper wrapper--light-grey-bg wrapper--form wrapper--sidebar">
14-
<div class="wrapper--sidebar--inner">
15-
<form class="form" action="" method="post">
16-
{% csrf_token %}
17-
<p><strong>{% blocktrans %}Are you sure you want to withdraw "{{ object }}" from consideration?{% endblocktrans %}</strong></p>
18-
<button class="button button--warning button--submit button--top-space" type="submit">{% trans "Confirm" %}</button>
19-
</form>
13+
<div class="wrapper wrapper--light-grey-bg wrapper--form wrapper--sidebar">
14+
<div class="wrapper--sidebar--inner">
15+
<form class="form" action="" method="post">
16+
{% csrf_token %}
17+
<p><strong>{% blocktrans %}Are you sure you want to withdraw "{{ object }}" from consideration?{% endblocktrans %}</strong></p>
18+
<button class="button button--warning button--submit button--top-space" type="submit">{% trans "Confirm" %}</button>
19+
</form>
20+
</div>
2021
</div>
21-
</div>
2222

2323
{% endblock %}

hypha/apply/funds/urls.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@
195195
"download/", SubmissionDetailPDFView.as_view(), name="download"
196196
),
197197
path("delete/", SubmissionDeleteView.as_view(), name="delete"),
198-
path('withdraw/', SubmissionWithdrawView.as_view(), name="withdraw"),
198+
path(
199+
"withdraw/", SubmissionWithdrawView.as_view(), name="withdraw"
200+
),
199201
path(
200202
"documents/<uuid:field_id>/<str:file_name>",
201203
SubmissionPrivateMediaView.as_view(),

hypha/apply/funds/views.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,10 +1582,11 @@ def form_valid(self, form):
15821582
# delete submission and redirect to success url
15831583
return super().form_valid(form)
15841584

1585+
15851586
class SubmissionWithdrawView(SingleObjectTemplateResponseMixin, BaseDetailView):
15861587
model = ApplicationSubmission
1587-
success_url = reverse_lazy('funds:submissions:list')
1588-
template_name_suffix = '_confirm_withdraw'
1588+
success_url = reverse_lazy("funds:submissions:list")
1589+
template_name_suffix = "_confirm_withdraw"
15891590

15901591
def post(self, request, *args, **kwargs):
15911592
return self.withdraw(request, *args, **kwargs)
@@ -1599,20 +1600,22 @@ def withdraw(self, request, *args, **kwargs):
15991600

16001601
obj = self.get_object()
16011602

1602-
withdraw_actions = [action for action in obj.workflow[obj.status].transitions.keys() if 'withdraw' in action]
1603+
withdraw_actions = [
1604+
action
1605+
for action in obj.workflow[obj.status].transitions.keys()
1606+
if "withdraw" in action
1607+
]
16031608

16041609
if len(withdraw_actions) > 0:
16051610
action = withdraw_actions[0]
16061611
obj.perform_transition(
1607-
action,
1608-
self.request.user,
1609-
request=self.request,
1610-
notify=False
1612+
action, self.request.user, request=self.request, notify=False
16111613
)
16121614

16131615
success_url = obj.get_absolute_url()
16141616
return HttpResponseRedirect(success_url)
16151617

1618+
16161619
@method_decorator(login_required, name="dispatch")
16171620
class SubmissionPrivateMediaView(UserPassesTestMixin, PrivateMediaView):
16181621
raise_exception = True

hypha/apply/funds/workflow.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,7 +1212,10 @@ def get_stage_change_actions():
12121212
active_statuses = [
12131213
status
12141214
for status, _ in PHASES
1215-
if "accepted" not in status and "rejected" not in status and "invited" not in status and "withdrawn" not in status
1215+
if "accepted" not in status
1216+
and "rejected" not in status
1217+
and "invited" not in status
1218+
and "withdrawn" not in status
12161219
]
12171220

12181221

@@ -1294,7 +1297,6 @@ def get_withdrawn_statuses():
12941297
return withdrawn_statuses
12951298

12961299

1297-
ext_or_higher_statuses = get_ext_or_higher_statuses()
12981300
review_statuses = get_review_statuses()
12991301
ext_review_statuses = get_ext_review_statuses()
13001302
ext_or_higher_statuses = get_ext_or_higher_statuses()

hypha/settings/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
SUBMISSION_PREVIEW_REQUIRED = env.bool("SUBMISSION_PREVIEW_REQUIRED", True)
160160

161161
# Allow Withdrawing of Submissions
162-
ENABLE_SUBMISSION_WITHDRAWAL = env.bool('ENABLE_SUBMISSION_WITHDRAWAL', False)
162+
ENABLE_SUBMISSION_WITHDRAWAL = env.bool("ENABLE_SUBMISSION_WITHDRAWAL", False)
163163

164164
# Project settings.
165165

0 commit comments

Comments
 (0)