Skip to content

Instantly share code, notes, and snippets.

@uday12kumar
Last active January 28, 2020 12:30
Show Gist options
  • Save uday12kumar/202b841ffcdbe668ebdf67c8714f9d82 to your computer and use it in GitHub Desktop.
Save uday12kumar/202b841ffcdbe668ebdf67c8714f9d82 to your computer and use it in GitHub Desktop.
@classmethod
def cancel(cls, id, seats_selected):
with transaction.atomic():
slot= (cls.objects.select_for_update().get(id=id))
slot.seats += seats_selected
slot.save()
return slot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment