Skip to content

Commit

Permalink
'Refactored by Sourcery'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sourcery AI committed Feb 2, 2023
1 parent 5aec756 commit cfbca6a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions netbox_acls/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ def validate(self, data):
- Check that the GFK object is valid.
- Check if Access List has no existing rules before change the Access List's type.
"""
error_message = {}

# Check that the GFK object is valid.
assigned_object = validate_gfk(data)

Expand All @@ -137,7 +135,7 @@ def validate(self, data):
{"type": ["This ACL has ACL rules associated, CANNOT change ACL type."]}
)

if error_message:
if error_message := {}:
raise serializers.ValidationError(error_message)

return super().validate(data)
Expand Down
2 changes: 1 addition & 1 deletion netbox_acls/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_root(self):
Test the API root
"""
url = reverse("plugins-api:netbox_acls-api:api-root")
response = self.client.get("{}?format=api".format(url), **self.header)
response = self.client.get(f"{url}?format=api", **self.header)

self.assertEqual(response.status_code, status.HTTP_200_OK)

Expand Down

0 comments on commit cfbca6a

Please sign in to comment.