Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Clean up after debugging
Pacu295b6d676e672
diff --git a/requirements.txt b/requirements.txtindex cdb1123383..0f66195645 100644--- a/requirements.txt+++ b/requirements.txt@@ -65,7 +65,7 @@ graphene==2.1.3 # via django-graphql-jwt, graphene-djangographql-core==2.1 # via graphene, graphene-django, graphql-relaygraphql-relay==0.4.5 # via graphenehtml5lib==1.0.1 # via bleach, weasyprint-idna==2.6 # via cryptography, requests, yarl+idna==2.6 # via cryptography, requestsiso8601==0.1.12 # via graphene-djangojmespath==0.9.3 # via boto3, botocorejsonfield==2.0.2@@ -73,7 +73,6 @@ kombu==4.2.1 # via celerymarkdown==2.6.11maxminddb-geolite2==2017.803maxminddb==1.3.0-multidict==4.3.1 # via yarloauthlib==2.0.6 # via requests-oauthlib, social-auth-corepdfrw==0.4 # via weasyprintphonenumberslite==8.9.1@@ -119,4 +118,3 @@ weasyprint==0.42.2webencodings==0.5.1 # via html5lib, tinycss2wrapt==1.10.11 # via vcrpyxmltodict==0.11.0 # via django-payments-yarl==1.2.6 # via vcrpydiff --git a/saleor/core/management/commands/populatedb.py b/saleor/core/management/commands/populatedb.pyindex 7fd28c0e9b..519ec15a00 100644--- a/saleor/core/management/commands/populatedb.py+++ b/saleor/core/management/commands/populatedb.py@@ -7,8 +7,8 @@ from ...utils import create_superuserfrom ...utils.random_data import (add_address_to_admin, create_collections_by_schema, create_menus,create_orders, create_page, create_product_sales,- create_products_by_schema, create_shipping_methods, create_translations,- create_users, create_vouchers, set_featured_products)+ create_products_by_schema, create_shipping_methods, create_users,+ create_vouchers, set_featured_products)class Command(BaseCommand):@@ -52,11 +52,11 @@ class Command(BaseCommand):def handle(self, *args, **options):self.make_database_faster()- create_images = False and not options['withoutimages']+ create_images = not options['withoutimages']for msg in create_shipping_methods():self.stdout.write(msg)- create_products_by_schema(- self.placeholders_dir, 10, create_images, stdout=self.stdout)+ create_products_by_schema(self.placeholders_dir, 10, create_images,+ stdout=self.stdout)for msg in create_product_sales(5):self.stdout.write(msg)for msg in create_vouchers():@@ -73,7 +73,7 @@ class Command(BaseCommand):self.stdout.write(msg)for msg in create_menus():self.stdout.write(msg)- create_translations()+if options['createsuperuser']:credentials = {'email': '[email protected]', 'password': 'admin'}msg = create_superuser(credentials)diff --git a/saleor/core/utils/random_data.py b/saleor/core/utils/random_data.pyindex 040ce572e7..e68e911de0 100644--- a/saleor/core/utils/random_data.py+++ b/saleor/core/utils/random_data.py@@ -23,7 +23,7 @@ from ...core.utils.text import strip_html_and_truncatefrom ...dashboard.menu.utils import update_menufrom ...discount import DiscountValueType, VoucherTypefrom ...discount.models import Sale, Voucher-from ...menu.models import Menu, MenuItem+from ...menu.models import Menufrom ...order.models import Fulfillment, Order, Paymentfrom ...order.utils import update_order_statusfrom ...page.models import Page@@ -34,7 +34,6 @@ from ...product.thumbnails import create_product_thumbnailsfrom ...product.utils.attributes import get_name_from_attributesfrom ...shipping.models import ANY_COUNTRY, ShippingMethodfrom ...shipping.utils import get_taxed_shipping_price-from ...site.models import SiteSettingsfake = Factory.create()@@ -653,77 +652,3 @@ def get_product_list_images_dir(placeholder_dir):def get_image(image_dir, image_name):img_path = os.path.join(image_dir, image_name)return File(open(img_path, 'rb'))---def create_translations():- # Helper function for debugging storefront- from saleor.product.models import (- AttributeChoiceValueTranslation,- CategoryTranslation, CollectionTranslation, ProductTranslation,- ProductVariantTranslation, ProductAttributeTranslation)- from saleor.page.models import PageTranslation- from saleor.menu.models import MenuItemTranslation- from saleor.site.models import SiteSettingsTranslation- from saleor.discount.models import Voucher, VoucherTranslation-- for i, category in enumerate(Category.objects.all()):- CategoryTranslation.objects.create(- language_code='pl', name='Kategoria %s' % category.pk,- category=category,- seo_title='Seo tytul kategoria %s' % category.pk,- seo_description='Seo opis kategoria %s' % category.pk)-- for i, product in enumerate(Product.objects.all()):- ProductTranslation.objects.create(- language_code='pl', name='Produkt %s' % product.pk,- product=product, description='Opis produktu %s' % product.pk,- seo_title='Seo tytul produkt %s' % product.pk,- seo_description='Seo opis produkt %s' % product.pk)-- for i, variant in enumerate(ProductVariant.objects.all()):- ProductVariantTranslation.objects.create(- language_code='pl',- name='Produkt %s Wariant %s' % (variant.product.pk, variant.pk),- product_variant=variant)-- for i, collection in enumerate(Collection.objects.all()):- CollectionTranslation.objects.create(- language_code='pl', name='Kolekcja %s' % collection.pk,- collection=collection,- seo_title='Seo tytul kolekcja %s' % collection.pk,- seo_description='Seo opis kolekcja %s' % collection.pk)-- for i, menu_item in enumerate(MenuItem.objects.all()):- name = 'Przedmiot %s' % menu_item.pk- MenuItemTranslation.objects.create(- language_code='pl', name=name,- menu_item=menu_item)-- for i, page in enumerate(Page.objects.all()):- PageTranslation.objects.create(- language_code='pl', title='Strona %s' % page.pk,- page=page, content='Zawartosc strony %s' % page.pk,- seo_title='Seo tytul strona %s' % page.pk,- seo_description='Seo opis strona %s' % page.pk)-- for attr in ProductAttribute.objects.all():- ProductAttributeTranslation.objects.create(- language_code='pl', name='Atrybut %s' % attr.pk,- product_attribute=attr)-- for value in AttributeChoiceValue.objects.all():- AttributeChoiceValueTranslation.objects.create(- language_code='pl', name='Wartość %s' % value.pk,- attribute_choice_value=value)-- for site_set in SiteSettings.objects.all():- SiteSettingsTranslation.objects.create(- site_settings=site_set, language_code='pl',- header_text='Tekst nagłówka po polsku %s' % site_set.pk,- description='Opis strony, tez po polsku %s' % site_set.pk)- for voucher in Voucher.objects.all():- VoucherTranslation.objects.create(- voucher=voucher, name='Nazwa vouchera')- from ...dashboard.menu.utils import update_menu- for menu in Menu.objects.all():- update_menu(menu)diff --git a/saleor/dashboard/menu/forms.py b/saleor/dashboard/menu/forms.pyindex 35303240c9..9d1d44b275 100644--- a/saleor/dashboard/menu/forms.py+++ b/saleor/dashboard/menu/forms.py@@ -26,9 +26,6 @@ class MenuForm(forms.ModelForm):labels = {'name': pgettext_lazy('Menu name', 'Menu name')}- def save(self, commit=True):- return super().save(commit)-class MenuItemForm(forms.ModelForm):"""Add or update menu item.diff --git a/templates/base.html b/templates/base.htmlindex 9eb28938f8..e94aef3692 100644--- a/templates/base.html+++ b/templates/base.html@@ -17,7 +17,7 @@<meta name="msapplication-TileColor" content="#2b5797"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black">- <meta name="apple-mobile-web-app-title" content="{{ site.settings.translated.header_text }}">+ <meta name="apple-mobile-web-app-title" content="{{ site.name }}"><meta name="og:type" content="website">{% get_available_languages as LANGUAGES %}{% for lang_code, language_name in LANGUAGES %}