Skip to content

Commit a34af98

Browse files
committed
Delete submission comments with the submission, remove extra period from middleware
1 parent 43c3968 commit a34af98

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

hypha/apply/funds/views/submission_delete.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ def form_valid(self, form):
4444
source=submission,
4545
)
4646

47-
# Delete NEW_SUBMISSION event for this particular submission, if any.
47+
# Delete NEW_SUBMISSION & COMMENT events for this particular submission, if any.
4848
# Otherwise, the submission deletion will fail.
4949
Event.objects.filter(
50-
type=MESSAGES.NEW_SUBMISSION, object_id=submission.id
50+
type__in=[MESSAGES.NEW_SUBMISSION, MESSAGES.COMMENT],
51+
object_id=submission.id,
5152
).delete()
5253

5354
# delete submission and redirect to success url

hypha/apply/middleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def process_exception(self, request, exception):
1313
messages.error(
1414
request,
1515
_(
16-
"The object you are trying to delete is used somewhere. Please remove any usages and try again!."
16+
"The object you are trying to delete is used somewhere. Please remove any usages and try again!"
1717
),
1818
)
1919
return HttpResponseRedirect(request.path)

0 commit comments

Comments
 (0)