-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new fields to Channel model (#11713)
- Loading branch information
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 3.2.16 on 2022-12-08 09:00 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("channel", "0005_channel_allocation_strategy"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="channel", | ||
name="automatically_confirm_all_new_orders", | ||
field=models.BooleanField(default=True, null=True), | ||
), | ||
migrations.AddField( | ||
model_name="channel", | ||
name="automatically_fulfill_non_shippable_gift_card", | ||
field=models.BooleanField(default=True, null=True), | ||
), | ||
] |
29 changes: 29 additions & 0 deletions
29
saleor/channel/migrations/0007_order_settings_per_channel.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from django.db import migrations | ||
|
||
|
||
def set_order_settings(apps, schema_editor): | ||
SiteSettings = apps.get_model("site", "SiteSettings") | ||
Channel = apps.get_model("channel", "Channel") | ||
|
||
site_settings = SiteSettings.objects.first() | ||
|
||
Channel.objects.update( | ||
automatically_confirm_all_new_orders=( | ||
site_settings.automatically_confirm_all_new_orders | ||
), | ||
automatically_fulfill_non_shippable_gift_card=( | ||
site_settings.automatically_fulfill_non_shippable_gift_card | ||
), | ||
) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("channel", "0006_order_settings_fields"), | ||
("site", "0032_gift_card_settings"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(set_order_settings, migrations.RunPython.noop), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters