Skip to content

Commit

Permalink
♻️ [#3626] Split up method making the URL
Browse files Browse the repository at this point in the history
  • Loading branch information
SilviaAmAm committed Nov 22, 2023
1 parent e64e1bb commit 8a7abba
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/openforms/submissions/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,8 @@ def update(self, instance, validated_data):
transaction.on_commit(lambda: self.notify_suspension(instance, email))
return instance

def notify_suspension(self, instance: Submission, email: str):
def get_continue_url(self, instance: Submission) -> str:
token = submission_resume_token_generator.make_token(instance)
config = GlobalConfiguration.get_solo()

continue_path = reverse(
"submissions:resume",
Expand All @@ -314,10 +313,12 @@ def notify_suspension(self, instance: Submission, email: str):
"submission_uuid": instance.uuid,
},
)
continue_url = build_absolute_uri(
continue_path, request=self.context.get("request")
)
return build_absolute_uri(continue_path, request=self.context.get("request"))

def notify_suspension(self, instance: Submission, email: str):
continue_url = self.get_continue_url(instance)

config = GlobalConfiguration.get_solo()
days_until_removal = (
instance.form.incomplete_submissions_removal_limit
or config.incomplete_submissions_removal_limit
Expand Down

0 comments on commit 8a7abba

Please sign in to comment.