self.storage_path_id = other.storage_path_id
if self.owner_id is None:
self.owner_id = other.owner_id
+
# merge
- # TODO: Handle the case where other is also None
if self.tag_ids is None:
self.tag_ids = other.tag_ids
- else:
+ elif other.tag_ids is not None:
self.tag_ids.extend(other.tag_ids)
+
if self.view_users is None:
self.view_users = other.view_users
- else:
+ elif other.view_users is not None:
self.view_users.extend(other.view_users)
+
if self.view_groups is None:
self.view_groups = other.view_groups
- else:
+ elif other.view_groups is not None:
self.view_groups.extend(other.view_groups)
+
if self.change_users is None:
self.change_users = other.change_users
- else:
+ elif other.change_users is not None:
self.change_users.extend(other.change_users)
+
if self.change_groups is None:
self.change_groups = other.change_groups
- else:
- self.change_groups = [
- *self.change_groups,
- *other.change_groups,
- ]
+ elif other.change_groups is not None:
+ self.change_groups.extend(other.change_groups)
return self
f"{len(message.attachments)} attachment(s)",
)
- tag_ids = [tag.id for tag in rule.assign_tags.all()]
+ tag_ids: list[int] = [tag.id for tag in rule.assign_tags.all()]
doc_type = rule.assign_document_type
if (