Skip to content

Commit

Permalink
lint care/facility/events/
Browse files Browse the repository at this point in the history
  • Loading branch information
sainak committed Sep 24, 2024
1 parent e561f58 commit 9214baa
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions care/facility/events/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def create_consultation_event_entry(
fields: set[str] = (
get_changed_fields(old_instance, object_instance)
if old_instance
else {field.name for field in object_instance._meta.fields}
else {field.name for field in object_instance._meta.fields} # noqa: SLF001
)

fields_to_store = fields_to_store & fields if fields_to_store else fields
Expand Down Expand Up @@ -91,11 +91,10 @@ def create_consultation_events(
taken_at = created_date

with transaction.atomic():
if isinstance(objects, (QuerySet, list, tuple)):
if isinstance(objects, QuerySet | list | tuple):
if old is not None:
raise ValueError(
"diff is not available when objects is a list or queryset"
)
msg = "diff is not available when objects is a list or queryset"
raise ValueError(msg)
for obj in objects:
create_consultation_event_entry(
consultation_id,
Expand Down

0 comments on commit 9214baa

Please sign in to comment.