Skip to content

Commit

Permalink
fix: make shared backend code compatible with black 24.4.2
Browse files Browse the repository at this point in the history
refs YJDH-696 (preparations)
  • Loading branch information
karisal-anders committed Jul 18, 2024
1 parent 19cea8c commit 6547de6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 2 additions & 3 deletions backend/shared/shared/audit_log/audit_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def log(
"""
current_time = get_time()
user_id = str(actor.pk) if getattr(actor, "pk", None) else ""
provider = DJANGO_BACKEND_MAPPING[actor_backend] if actor_backend else ""

if actor is None:
role = Role.SYSTEM
Expand All @@ -67,9 +68,7 @@ def log(
"actor": {
"role": str(role.value),
"user_id": user_id,
"provider": DJANGO_BACKEND_MAPPING[actor_backend]
if actor_backend
else "",
"provider": provider,
"ip_address": ip_address,
},
"operation": str(operation.value),
Expand Down
8 changes: 5 additions & 3 deletions backend/shared/shared/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ def any_of_q_filter(**kwargs):
return reduce(
operator.or_,
(
~Q(**{key[len("not__") :]: value})
if key.startswith("not__")
else Q(**{key: value})
(
~Q(**{key[len("not__") :]: value})
if key.startswith("not__")
else Q(**{key: value})
)
for key, value in kwargs.items()
),
)
Expand Down

0 comments on commit 6547de6

Please sign in to comment.