Skip to content

Commit

Permalink
👌 [#2192] PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbal committed Mar 15, 2024
1 parent 3a44a8c commit 86d3e57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/open_inwoner/accounts/views/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,9 @@ def form_valid(self, form):

# Display errors raised by Laposta API
if form.errors:
self.log_user_action(
self.request.user, _("failed to modify user newsletter subscription")
)
return self.form_invalid(form)

messages.success(self.request, _("Uw wijzigingen zijn opgeslagen"))
Expand Down
1 change: 1 addition & 0 deletions src/open_inwoner/laposta/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def remove_subscription(self, list_id: str, member_id: str) -> Member | None:
# Handle scenario where a subscription does not exists in the API,
# but it does exist locally
if error.get("code") == 203 and error.get("parameter") == "member_id":
logger.info("Subscription does not exist for user")
return None

data = get_json_response(response)
Expand Down

0 comments on commit 86d3e57

Please sign in to comment.