Skip to content

Commit

Permalink
🏷️ - fix: fix type issues with default values for variables
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvandescheur committed Oct 18, 2024
1 parent 75ceb53 commit dc042d5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions backend/src/openarchiefbeheer/destruction/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,9 @@ def update(
) -> DestructionList:
user = self.context["request"].user
validated_data.pop("reviewer", None)
add_data = validated_data.pop("add", None)
remove_data = validated_data.pop("remove", None)
items_data = validated_data.pop("items", None)
add_data = validated_data.pop("add", [])
remove_data = validated_data.pop("remove", [])
items_data = validated_data.pop("items", [])
instance.contains_sensitive_info = validated_data.pop(
"contains_sensitive_info", instance.contains_sensitive_info
)
Expand All @@ -278,15 +278,15 @@ def update(

instance.name = validated_data.pop("name", instance.name)

if items_data is not None or bulk_select:
if items_data or bulk_select:
instance.items.all().delete()

zaken = self._get_zaken(zaak_filters, items_data, bulk_select)

instance.add_items(zaken)

if add_data:
zaken = self._get_zaken(zaak_filters, add_data or [], bulk_select)
zaken = self._get_zaken(zaak_filters, add_data, bulk_select)
self.instance.add_items(zaken)

if remove_data:
Expand Down

0 comments on commit dc042d5

Please sign in to comment.