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:
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user