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

PolicyRule Serializer - Zone field appears to use incorrect serializer #136

Closed
whitej6 opened this issue Feb 14, 2023 · 2 comments
Closed

Comments

@whitej6
Copy link
Contributor

whitej6 commented Feb 14, 2023

Environment

  • Python version: NA
  • Nautobot version: 1.5.10
  • nautobot-plugin-firewall-model version: 1.1.X & 1.2.0

Expected Behavior

UUID should be able to be used for API when adding a zone to a policy rule

Observed Behavior

Requires full zone payload

Steps to Reproduce

@Cymmus
Copy link

Cymmus commented Feb 22, 2023

I have the same problem.

Easy to fix i think. Need to change the Serializer in api/serializers line 230 in class PolicyRuleSerializer.

Change:
source_zone = ZoneSerializer(required=False)

With:
source_zone = SerializedPKRelatedField(
queryset=models.Zone.objects.all(), serializer=ZoneSerializer, required=False
)

and same thing for the destination zone line 240.

@whitej6
Copy link
Contributor Author

whitej6 commented May 3, 2023

Resolved by #146

@whitej6 whitej6 closed this as completed May 3, 2023
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