@@ -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+
15851586class 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" )
16171620class SubmissionPrivateMediaView (UserPassesTestMixin , PrivateMediaView ):
16181621 raise_exception = True
0 commit comments