Skip to content

Commit

Permalink
Merge pull request RedHatInsights#939 from petracihalova/refactoring
Browse files Browse the repository at this point in the history
refactor: improved code to by more pythonic and to make my linter happy
  • Loading branch information
lpichler authored Oct 17, 2023
2 parents 0a28e04 + 789acd2 commit cc30153
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rbac/management/role/serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from .model import Access, Permission, ResourceDefinition, Role

ALLOWED_OPERATIONS = ["in", "equal"]
FILTER_FIELDS = set(["key", "value", "operation"])
FILTER_FIELDS = {"key", "value", "operation"}


class ResourceDefinitionSerializer(SerializerCreateOverrideMixin, serializers.ModelSerializer):
Expand Down
2 changes: 1 addition & 1 deletion rbac/management/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def get_admin_from_proxy(username, request):
"""Return org_admin status of a username from the proxy."""
bop_resp = verify_principal_with_proxy(username, request, verify_principal=True)

if bop_resp.get("data") == []:
if not bop_resp.get("data"):
key = "detail"
message = "No data found for principal with username '{}'.".format(username)
raise serializers.ValidationError({key: _(message)})
Expand Down

0 comments on commit cc30153

Please sign in to comment.