Fix: Dont check empty ASNs

This commit is contained in:
shamoon 2024-11-05 19:36:10 -08:00
parent 005150c84f
commit 64095a710a

View File

@ -808,6 +808,8 @@ class DocumentSerializer(
def validate(self, attrs):
if (
"archive_serial_number" in attrs
and attrs["archive_serial_number"] is not None
and len(str(attrs["archive_serial_number"])) > 0
and Document.deleted_objects.filter(
archive_serial_number=attrs["archive_serial_number"],
).exists()