Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When PATCH-ing a destination, the error message returned for is_duplicate is useless #1111

Open
hmpf opened this issue Jan 7, 2025 · 1 comment
Assignees

Comments

@hmpf
Copy link
Contributor

hmpf commented Jan 7, 2025

/../ The API does not behave correctly when PATCH-ing the email-address unchanged, it only complains about

{
  "non_field_errors": [
    "email_address"
  ]
}

.. stripping away the detail of the error for the email-address.

It would probably be better to instead return 200 Ok and pretend the PATCH never happened.

Originally posted by @hmpf in #936 (comment)

@hmpf hmpf changed the title When PATCH-ing a destination, the error message returned for is_duplcate is useless When PATCH-ing a destination, the error message returned for is_duplicate is useless Jan 7, 2025
@hmpf
Copy link
Contributor Author

hmpf commented Jan 7, 2025

A better way to show the error would be to have "non_field_errors" be a list of dictionaries:

{
  "non_field_errors": [
    { 
      "email_address": "This destination already exists for this user" 
    }
  ]
}

@johannaengland johannaengland self-assigned this Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants