Skip to content

Commit

Permalink
chore(style): Use set for set inclusion condition
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Sep 27, 2024
1 parent aa34f9a commit 40e0e12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def update(self, request, *args, **kwargs):
if key in request.data:
setattr(table, key, request.data[key])
# Remove "grandchildren" (child tables of child tables) if such are present
if key in ("split", "include") and request.data[key] is False:
if key in {"split", "include"} and request.data[key] is False:
if table.array_tables and not table.parent:
for array_table in list(table.array_tables.all()):
setattr(array_table, key, False)
Expand Down Expand Up @@ -641,7 +641,7 @@ def patch(self, request, *args, **kwargs):
if serializer.is_valid():
flatten = Flatten.objects.get(id=kwargs["id"])
new_status = request.data.get("status", "")
if flatten.status not in (Flatten.FAILED, Flatten.COMPLETED):
if flatten.status not in {Flatten.FAILED, Flatten.COMPLETED}:
return Response(
{"detail": _("You can't reschedule flatten in (%s) status") % flatten.status},
status=status.HTTP_400_BAD_REQUEST,
Expand Down

0 comments on commit 40e0e12

Please sign in to comment.