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

[v2.2] Inconsistent required fields for Contact & Team for UI vs API #5489

Closed
joewesch opened this issue Mar 26, 2024 · 2 comments · Fixed by #5504
Closed

[v2.2] Inconsistent required fields for Contact & Team for UI vs API #5489

joewesch opened this issue Mar 26, 2024 · 2 comments · Fixed by #5504
Assignees
Labels
emergent Unplanned work that is brought into a sprint after it's started. type: bug Something isn't working as expected

Comments

@joewesch
Copy link
Contributor

joewesch commented Mar 26, 2024

Environment

  • Nautobot version (Docker tag too if applicable): 2.2.0b1
  • Python version: 3.11.8
  • Database platform, version:
  • Middleware(s):

Steps to Reproduce

  1. Try and create a Contact or Team via both UI and API

Expected Behavior

Either Phone and Email are required or not required for both methods

Observed Behavior

Phone and Email are not required for UI:
Screenshot 2024-03-26 at 3 45 29 PM
Phone and Email are required for API:
Screenshot 2024-03-26 at 3 45 21 PM

@joewesch joewesch added type: bug Something isn't working as expected triage This issue is new and has not been reviewed. labels Mar 26, 2024
@gsnider2195 gsnider2195 removed the triage This issue is new and has not been reviewed. label Mar 27, 2024
@glennmatthews
Copy link
Contributor

Looks like the recurrent DRF issue where any field included in a unique_together gets incorrectly auto-marked as required in the API. Solution is to override the automatically generated validators on the serializer and do the validation manually instead. (Example: https://github.com/nautobot/nautobot/blob/develop/nautobot/dcim/api/serializers.py#L208-L209 and https://github.com/nautobot/nautobot/blob/develop/nautobot/dcim/api/serializers.py#L239-L247)

@joewesch
Copy link
Contributor Author

FYI, it looks like Teams are also affected.

@joewesch joewesch changed the title [v2.2] Inconsistent required fields for Contact for UI vs API [v2.2] Inconsistent required fields for Contact & Team for UI vs API Mar 28, 2024
@glennmatthews glennmatthews self-assigned this Mar 29, 2024
@glennmatthews glennmatthews added the emergent Unplanned work that is brought into a sprint after it's started. label Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
emergent Unplanned work that is brought into a sprint after it's started. type: bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants