Skip to content

Instantly share code, notes, and snippets.

@klement97
Created January 4, 2021 21:18
Show Gist options
  • Save klement97/1bf16a5a533658c60d2b64cd1f718839 to your computer and use it in GitHub Desktop.
Save klement97/1bf16a5a533658c60d2b64cd1f718839 to your computer and use it in GitHub Desktop.
def print_receipt(self):
requests.post(
url=settings.RECEIPT_MICROSERVICE,
data=prepare_receipt_data(order=self)
)
def save(self, *args, **kwargs):
self.price = self.total_price
self.print_receipt()
super().save(*args, **kwargs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment