]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Fixes the ASN checking to allow an ASN of 0 (#7878)
authorTrenton H <797416+stumpylog@users.noreply.github.com>
Tue, 8 Oct 2024 19:47:37 +0000 (12:47 -0700)
committerGitHub <noreply@github.com>
Tue, 8 Oct 2024 19:47:37 +0000 (12:47 -0700)
src/documents/consumer.py

index 803d8251022d8c939883120f9ab916068113226c..f79d3f9c39aa02bd37bacf0972ace2306b5455a9 100644 (file)
@@ -348,7 +348,7 @@ class ConsumerPlugin(
         """
         Check that if override_asn is given, it is unique and within a valid range
         """
-        if not self.metadata.asn:
+        if self.metadata.asn is None:
             # check not necessary in case no ASN gets set
             return
         # Validate the range is above zero and less than uint32_t max
@@ -905,7 +905,7 @@ class ConsumerPlugin(
                 pk=self.metadata.storage_path_id,
             )
 
-        if self.metadata.asn:
+        if self.metadata.asn is not None:
             document.archive_serial_number = self.metadata.asn
 
         if self.metadata.owner_id: