diff --git a/brewman/brewman/models/voucher.py b/brewman/brewman/models/voucher.py index 55130cdf..f0d90a86 100644 --- a/brewman/brewman/models/voucher.py +++ b/brewman/brewman/models/voucher.py @@ -315,6 +315,7 @@ class Inventory(Base): self.product_id = product_id else: self.product = product + self.product_id = product.id if batch is None: self.batch_id = batch_id else: diff --git a/brewman/brewman/routers/fingerprint.py b/brewman/brewman/routers/fingerprint.py index c83dd318..c4da18b6 100644 --- a/brewman/brewman/routers/fingerprint.py +++ b/brewman/brewman/routers/fingerprint.py @@ -86,6 +86,7 @@ def read_file(input_file: UploadFile): else: encoding = "ascii" # raise ValidationError("The encoding of the attendance file is not correct") + input_file.file.close() return StringIO(output.decode(encoding))