diff --git a/opentech/apply/determinations/forms.py b/opentech/apply/determinations/forms.py index f33e4fe288e2094fbdffb8738cdb442ab8579b6b..1ef0848bf65c8c22322c0df23b160f4813a9860c 100644 --- a/opentech/apply/determinations/forms.py +++ b/opentech/apply/determinations/forms.py @@ -68,7 +68,7 @@ class BaseDeterminationForm(forms.ModelForm): if self.draft_button_name not in self.data: action_name = self.request.GET.get('action') or \ - self.get_action_name_from_determination(int(cleaned_data['determination'])) + self.get_action_name_from_determination(int(cleaned_data['determination'])) if action_name: transition = self.submission.get_transition(action_name) if not can_proceed(transition): @@ -109,7 +109,7 @@ class BaseDeterminationForm(forms.ModelForm): # Use get_available_status_transitions()? for key, _ in self.submission.phase.transitions.items(): - if suffix in key: + if suffix in key: action_name = key break diff --git a/opentech/apply/determinations/templatetags/determination_tags.py b/opentech/apply/determinations/templatetags/determination_tags.py index ecb5e4e1b759b92749436b39214f6e105ffdd33f..812b3eade0a207eaf2836cd99977e7e41b6a046b 100644 --- a/opentech/apply/determinations/templatetags/determination_tags.py +++ b/opentech/apply/determinations/templatetags/determination_tags.py @@ -22,14 +22,14 @@ def can_add_determination(user, submission): """ try: has_determination_response = submission.determination \ - and not submission.determination.is_draft \ - and submission.determination.determination != UNDETERMINED + and not submission.determination.is_draft \ + and submission.determination.determination != UNDETERMINED except ObjectDoesNotExist: has_determination_response = False return submission.user_lead_or_admin(user) \ - and submission.status in DETERMINATION_PHASES \ - and not has_determination_response + and submission.status in DETERMINATION_PHASES \ + and not has_determination_response @register.filter @@ -52,8 +52,8 @@ def pending_determination(submission, user): if submission.status in DETERMINATION_PHASES: try: return not submission.determination \ - or (submission.determination.is_draft and not user.is_apply_staff) \ - or submission.determination.determination == UNDETERMINED + or (submission.determination.is_draft and not user.is_apply_staff) \ + or submission.determination.determination == UNDETERMINED except ObjectDoesNotExist: return True diff --git a/opentech/apply/determinations/views.py b/opentech/apply/determinations/views.py index bc90a50c7bf04118c80aa8874ae1c120c78f574a..f3ae5bc47e2dd97daac38d1ef29f6545fb7af2dd 100644 --- a/opentech/apply/determinations/views.py +++ b/opentech/apply/determinations/views.py @@ -59,7 +59,7 @@ class DeterminationCreateOrUpdateView(CreateOrUpdateView): def get_context_data(self, **kwargs): try: has_determination_response = self.submission.determination.determination != UNDETERMINED \ - and not self.submission.determination.is_draft + and not self.submission.determination.is_draft except ObjectDoesNotExist: has_determination_response = False diff --git a/opentech/apply/funds/views.py b/opentech/apply/funds/views.py index bde5c1306471ad2f8f18abd6c62a4d13dfe2175f..c7c79262f3955bdfe1abfee0e8e41e26a2825558 100644 --- a/opentech/apply/funds/views.py +++ b/opentech/apply/funds/views.py @@ -75,8 +75,9 @@ class ProgressSubmissionView(DelegatedViewMixin, UpdateView): action = form.cleaned_data.get('action') # Defer to the determination form for any of the determination transitions if action in DETERMINATION_RESPONSE_TRANSITIONS: - return HttpResponseRedirect(reverse_lazy('apply:submissions:determinations:form', args=(form.instance.id,)) - + "?action=" + action) + return HttpResponseRedirect(reverse_lazy( + 'apply:submissions:determinations:form', + args=(form.instance.id,)) + "?action=" + action) response = super().form_valid(form) return self.progress_stage(form.instance) or response