Skip to content

Commit

Permalink
Retrive xform out of the transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
noliveleger committed Oct 4, 2023
1 parent 84a81ed commit d74be5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions onadata/apps/logger/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ def post_save_attachment(instance, created, **kwargs):
if not file_size:
return

with transaction.atomic():
xform = attachment.instance.xform
xform = attachment.instance.xform

with transaction.atomic():
UserProfile.objects.filter(user_id=xform.user_id).update(
attachment_storage_bytes=F('attachment_storage_bytes') + file_size
)
Expand Down

0 comments on commit d74be5d

Please sign in to comment.