models.py: fix Chunk not having upload_id

This commit is contained in:
dogeystamp 2023-05-07 22:17:05 -04:00
parent 843e89511a
commit d7e93880a2
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38

View File

@ -397,6 +397,7 @@ class Chunk(db.Model):
self.upload = Upload.query.filter_by(upload_id=upload_id).first()
if self.upload is None:
self.upload = Upload(upload_id, total_chunks, share.share_id)
self.upload_id = upload_id
self.upload.recv_chunks = 0
db.session.add(self.upload)