fix: in django42 QuerySet.update_or_create() save only fields passed … (#33174)

* fix: in django42 QuerySet.update_or_create() save only fields passed in defaults
This commit is contained in:
Awais Qureshi
2023-09-08 14:48:07 +05:00
committed by GitHub
parent 561593e170
commit 22cc66eaf7

View File

@@ -53,9 +53,11 @@ class Command(BaseCommand):
checkout_on_ecommerce = options.get('checkout_on_ecommerce')
# We are keeping id=1, because as of now, there are only one commerce configuration for the system.
pk_id = 1
CommerceConfiguration.objects.update_or_create(
id=1,
id=pk_id,
defaults={
'id': pk_id,
'enabled': not disable,
'checkout_on_ecommerce_service': checkout_on_ecommerce,
}