Skip to content

Commit

Permalink
fix: run ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
gertzakis committed Feb 13, 2024
1 parent 34652e8 commit caeaa35
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion nautobot/core/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ def has_perm(self, user_obj, perm, obj=None):
if model._meta.label_lower != ".".join((app_label, model_name)):
raise ValueError(f"Invalid permission {perm} for model {model}")

# Compile a query filter that matches all instances of the specified model
# Compile a QuerySet filter that matches all instances of the specified model
tokens = {
"$user": user_obj,
Expand Down
2 changes: 1 addition & 1 deletion nautobot/users/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def clean(self):
for ct in object_types:
model = ct.model_class()
try:
tokens={"$user": 0} # setting token to null user ID
tokens = {"$user": 0} # setting token to null user ID
model.objects.filter(qs_filter_from_constraints(constraints, tokens)).exists()
except FieldError as e:
raise ValidationError({"constraints": f"Invalid filter for {model}: {e}"})
Expand Down

0 comments on commit caeaa35

Please sign in to comment.