Features: None;
Fixes: 1) Prevent error by adding user check when processing non-PENDING orders; 2) Remove redundant status assignment and save for CREATED orders; 3) Add missing error handler for POST requests in settings; Extra: None;
This commit is contained in:
parent
3185eb8188
commit
82667216f2
2 changed files with 2 additions and 3 deletions
|
|
@ -62,7 +62,7 @@ def create_promocode_on_user_referring(instance, created, **kwargs):
|
|||
@receiver(post_save, sender=Order)
|
||||
def process_order_changes(instance, created, **kwargs):
|
||||
if not created:
|
||||
if instance.status != "PENDING":
|
||||
if instance.status != "PENDING" and instance.user:
|
||||
pending_orders = Order.objects.filter(user=instance.user, status="PENDING")
|
||||
|
||||
if not pending_orders.exists():
|
||||
|
|
@ -80,8 +80,6 @@ def process_order_changes(instance, created, **kwargs):
|
|||
if instance.status == "CREATED":
|
||||
if not instance.is_whole_digital:
|
||||
send_order_created_email.delay(instance.uuid)
|
||||
instance.status = "DELIVERING"
|
||||
instance.save()
|
||||
for order_product in instance.order_products.filter(status="DELIVERING"):
|
||||
if not order_product.product.is_digital:
|
||||
continue
|
||||
|
|
|
|||
|
|
@ -296,6 +296,7 @@ if getenv("SENTRY_DSN"):
|
|||
debug=False,
|
||||
ignore_errors=[
|
||||
"flower.views.error.NotFoundErrorHandler.get",
|
||||
"flower.views.error.NotFoundErrorHandler.post",
|
||||
"django.http.response.Http404",
|
||||
"billiard.exceptions.SoftTimeLimitExceeded",
|
||||
"core.models.Product.DoesNotExist",
|
||||
|
|
|
|||
Loading…
Reference in a new issue