Skip to content

Commit

Permalink
Merge branch 'master' into add-products-csv-export
Browse files Browse the repository at this point in the history
  • Loading branch information
IKarbowiak committed Jun 17, 2020
2 parents 10654c4 + e20b628 commit 0b0426f
Show file tree
Hide file tree
Showing 19 changed files with 58 additions and 239 deletions.
5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ sudo: false
python:
- "3.8"

branches:
only:
- master
- /next\/.*/

cache:
pip: true
directories:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ All notable, unreleased changes to this project will be documented in this file.
- Fix specific product voucher in draft orders - #5727 by @fowczarek
- Add products csv export - #5255 by @IKarbowiak
- Explicit country assignment in default shipping zones - #5736 by @maarcingebala
- Drop `json_content` field from the `Menu` model - #5761 by @maarcingebala

## 2.10.1

Expand Down
18 changes: 9 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ documentation = "https://docs.getsaleor.com/en/latest/"
[tool.poetry.dependencies]
python = "~3.8"
babel = "~2.8"
boto3 = "^1.13"
boto3 = "^1.14"
braintree = "~4.1.0"
celery = { version = "^4.4.5", extras = ["redis"] }
dj-database-url = "^0"
Expand All @@ -35,7 +35,7 @@ django-versatileimagefield = "^2.0"
draftjs-sanitizer = "^1.0.0"
faker = "^4.1"
freezegun = "^0"
google-cloud-storage = "^1.18.0"
google-cloud-storage = "^1.29.0"
google-i18n-address = "^2.3.5"
google-measurement-protocol = "^1.0"
graphene-django = "^2.10.1"
Expand All @@ -57,7 +57,7 @@ sentry-sdk = "^0"
stripe = "^2.47.0"
text-unidecode = "^1.2"
tqdm = "^4.46"
uwsgi = {version = "^2.0.8", platform = "!=win32"}
uwsgi = {version = "^2.0.19", platform = "!=win32"}
weasyprint = ">=48"
oauthlib = "^3.0"
jaeger-client = "^4.3.0"
Expand All @@ -66,26 +66,26 @@ django-cache-url = "^3.1.2"

[tool.poetry.dev-dependencies]
black = "19.10b0"
codecov = "^2.1.4"
codecov = "^2.1.7"
coverage = "^5.1"
django-debug-toolbar = "^2.0"
django-debug-toolbar-request-history = "^0"
django-graphiql-debug-toolbar = "^0.1.4"
django-extensions = "^2.2.1"
flake8 = "^3.8.2"
flake8 = "^3.8.3"
isort = "^4.3.21"
pre-commit = "^2.3"
pre-commit = "^2.5"
pycodestyle = "^2.5"
pydocstyle = "^5.0"
pylint = "^2.3.1"
pylint = "^2.5.3"
pylint-celery = "^0"
pylint-django = "^2.0.15"
pylint-plugin-utils = "^0"
pytest = "^5.4.3"
pytest-cov = "^2.9.0"
pytest-cov = "^2.10.0"
pytest-django = "^3.5.1"
pytest-django-queries = "~1.1"
pytest-mock = "^3.1.0"
pytest-mock = "^3.1.1"
pytest-vcr = "^1.0.2"
pytest-xdist = "^1.32"
tox = "^3.15.2"
Expand Down
13 changes: 7 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ asgiref==3.2.7
babel==2.8.0
beautifulsoup4==4.7.1
billiard==3.6.3.0
boto3==1.13.23
botocore==1.16.23
boto3==1.14.2
botocore==1.17.2
braintree==4.1.0
cachetools==4.1.0
cairocffi==1.1.0
cairosvg==2.4.2
celery==4.4.2
celery==4.4.5
certifi==2020.4.5.1
cffi==1.14.0
chardet==3.0.4
Expand All @@ -22,7 +22,7 @@ django==3.0.6
django-appconf==1.0.4
django-cache-url==3.1.2
django-countries==6.1.2
django-filter==2.2.0
django-filter==2.3.0
django-graphql-jwt==0.3.0
django-js-asset==1.2.2
django-measurement==3.2.3
Expand All @@ -41,10 +41,11 @@ enmerkar==0.7.1
et-xmlfile==1.0.1
faker==4.1.0
freezegun==0.3.15
future==0.18.2
google-api-core==1.19.0
google-auth==1.16.1
google-cloud-core==1.3.0
google-cloud-storage==1.28.1
google-cloud-storage==1.29.0
google-i18n-address==2.3.5
google-measurement-protocol==1.0.0
google-resumable-media==0.5.1
Expand Down Expand Up @@ -109,7 +110,7 @@ tornado==6.0.4
tqdm==4.46.1
typing==3.7.4.1
urllib3==1.25.9
uwsgi==2.0.18; sys_platform != "win32"
uwsgi==2.0.19; sys_platform != "win32"
vine==1.3.0
weasyprint==51
webencodings==0.5.1
32 changes: 18 additions & 14 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ beautifulsoup4==4.7.1
beautifultable==0.7.0
billiard==3.6.3.0
black==19.10b0
boto3==1.13.23
botocore==1.16.23
boto3==1.14.2
botocore==1.17.2
braintree==4.1.0
cachetools==4.1.0
cairocffi==1.1.0
cairosvg==2.4.2
celery==4.4.2
celery==4.4.5
certifi==2020.4.5.1
cffi==1.14.0
cfgv==3.1.0
chardet==3.0.4
click==7.1.2
codecov==2.1.4
codecov==2.1.7
colorama==0.4.3
coverage==5.1
cssselect2==0.3.0
Expand All @@ -36,9 +36,9 @@ django-appconf==1.0.4
django-cache-url==3.1.2
django-countries==6.1.2
django-debug-toolbar==2.2
django-debug-toolbar-request-history==0.1.2
django-debug-toolbar-request-history==0.1.3
django-extensions==2.2.9
django-filter==2.2.0
django-filter==2.3.0
django-graphiql-debug-toolbar==0.1.4
django-graphql-jwt==0.3.0
django-js-asset==1.2.2
Expand All @@ -60,12 +60,15 @@ et-xmlfile==1.0.1
execnet==1.7.1
faker==4.1.0
filelock==3.0.12
flake8==3.8.2
flake8==3.8.3
freezegun==0.3.15
future==0.18.2
gitdb==4.0.5
gitpython==3.1.3
google-api-core==1.19.0
google-auth==1.16.1
google-cloud-core==1.3.0
google-cloud-storage==1.28.1
google-cloud-storage==1.29.0
google-i18n-address==2.3.5
google-measurement-protocol==1.0.0
google-resumable-media==0.5.1
Expand Down Expand Up @@ -109,7 +112,7 @@ petl==1.3.0
phonenumberslite==8.12.5
pillow==7.1.2
pluggy==0.13.1
pre-commit==2.4.0
pre-commit==2.5.1
prices==1.0.0
promise==2.3
protobuf==3.12.2
Expand All @@ -123,14 +126,14 @@ pycparser==2.20
pydocstyle==5.0.2
pyflakes==2.2.0
pyjwt==1.7.1
pylint==2.5.2
pylint==2.5.3
pylint-celery==0.3
pylint-django==2.0.15
pylint-plugin-utils==0.6
pyparsing==2.4.7
pyphen==0.9.5
pytest==5.4.3
pytest-cov==2.9.0
pytest-cov==2.10.0
pytest-django==3.9.0
pytest-django-queries==1.1.0
pytest-forked==1.1.3
Expand All @@ -153,6 +156,7 @@ s3transfer==0.3.3
sentry-sdk==0.14.4
singledispatch==3.4.0.3
six==1.15.0
smmap==3.0.4
snowballstemmer==2.0.0
soupsieve==2.0.1
sqlparse==0.3.1
Expand All @@ -164,15 +168,15 @@ thrift==0.13.0
tinycss2==1.0.2
toml==0.10.1
tornado==6.0.4
tox==3.15.1
tox==3.15.2
tqdm==4.46.1
transifex-client==0.13.9
transifex-client==0.13.10
typed-ast==1.4.1
typing==3.7.4.1
typing-extensions==3.7.4.2
unidecode==1.1.1
urllib3==1.25.9
uwsgi==2.0.18; sys_platform != "win32"
uwsgi==2.0.19; sys_platform != "win32"
vcrpy==4.0.2
vine==1.3.0
virtualenv==20.0.21
Expand Down
2 changes: 0 additions & 2 deletions saleor/celeryconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

app = Celery("saleor")

CELERY_TIMEZONE = "UTC"

app.config_from_object("django.conf:settings", namespace="CELERY")
app.autodiscover_tasks()
app.autodiscover_tasks(lambda: discover_plugins_modules(settings.PLUGINS))
3 changes: 0 additions & 3 deletions saleor/core/utils/random_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
from ...discount.utils import fetch_discounts
from ...giftcard.models import GiftCard
from ...menu.models import Menu
from ...menu.utils import update_menu
from ...order.models import Fulfillment, Order, OrderLine
from ...order.utils import update_order_status
from ...page.models import Page
Expand Down Expand Up @@ -1205,8 +1204,6 @@ def create_menus():
)

yield "Created footer menu"
update_menu(top_menu)
update_menu(bottom_menu)
site = Site.objects.get_current()
site_settings = site.settings
site_settings.top_menu = top_menu
Expand Down
7 changes: 0 additions & 7 deletions saleor/graphql/menu/bulk_mutations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from ...core.permissions import MenuPermissions
from ...menu import models
from ...menu.utils import update_menus
from ..core.mutations import ModelBulkDeleteMutation
from ..core.types.common import MenuError

Expand Down Expand Up @@ -33,9 +32,3 @@ class Meta:
permissions = (MenuPermissions.MANAGE_MENUS,)
error_type_class = MenuError
error_type_field = "menu_errors"

@classmethod
def bulk_action(cls, queryset):
menu_ids = {item.menu_id for item in queryset}
queryset.delete()
update_menus(menu_ids)
12 changes: 0 additions & 12 deletions saleor/graphql/menu/mutations.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from ...core.permissions import MenuPermissions, SitePermissions
from ...menu import models
from ...menu.error_codes import MenuErrorCode
from ...menu.utils import update_menu
from ...page import models as page_models
from ...product import models as product_models
from ..core.mutations import BaseMutation, ModelDeleteMutation, ModelMutation
Expand Down Expand Up @@ -209,11 +208,6 @@ def clean_input(cls, info, instance, data):
)
return cleaned_input

@classmethod
def save(cls, info, instance, cleaned_input):
instance.save()
update_menu(instance.menu)


class MenuItemUpdate(MenuItemCreate):
class Arguments:
Expand Down Expand Up @@ -254,12 +248,6 @@ class Meta:
error_type_class = MenuError
error_type_field = "menu_errors"

@classmethod
def perform_mutation(cls, _root, info, **data):
response = super().perform_mutation(_root, info, **data)
update_menu(response.menuItem.menu)
return response


@dataclass(frozen=True)
class _MenuMoveOperation:
Expand Down
4 changes: 0 additions & 4 deletions saleor/graphql/menu/tests/benchmark/conftest.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import pytest

from .....menu.utils import update_menu


@pytest.fixture
def site_with_top_menu(site_settings):
menu = site_settings.top_menu
menu.items.create(name="Link 1", url="http://example.com/")
menu.items.create(name="Link 2", url="http://example.com/")
menu.items.create(name="Link 3", url="http://example.com/")
update_menu(menu)
return site_settings


Expand All @@ -19,5 +16,4 @@ def site_with_bottom_menu(site_settings):
menu.items.create(name="Link 1", url="http://example.com/")
menu.items.create(name="Link 2", url="http://example.com/")
menu.items.create(name="Link 3", url="http://example.com/")
update_menu(menu)
return site_settings
14 changes: 3 additions & 11 deletions saleor/graphql/menu/tests/test_bulk_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@

from ....menu.models import Menu, MenuItem
from ...tests.utils import get_graphql_content
from .utils import menu_item_to_json


@pytest.fixture
def menu_list():
menu_1 = Menu.objects.create(name="test-navbar-1", json_content={})
menu_2 = Menu.objects.create(name="test-navbar-2", json_content={})
menu_3 = Menu.objects.create(name="test-navbar-3", json_content={})
menu_1 = Menu.objects.create(name="test-navbar-1")
menu_2 = Menu.objects.create(name="test-navbar-2")
menu_3 = Menu.objects.create(name="test-navbar-3")
return menu_1, menu_2, menu_3


Expand Down Expand Up @@ -46,9 +45,6 @@ def test_delete_menu_items(staff_api_client, menu_item_list, permission_manage_m
}
}
"""
menu = menu_item_list[0].menu
items_json = [menu_item_to_json(item) for item in menu_item_list]

variables = {
"ids": [
graphene.Node.to_global_id("MenuItem", menu_item.id)
Expand All @@ -65,10 +61,6 @@ def test_delete_menu_items(staff_api_client, menu_item_list, permission_manage_m
id__in=[menu_item.id for menu_item in menu_item_list]
).exists()

menu.refresh_from_db()
for item_json in items_json:
assert item_json not in menu.json_content


def test_delete_empty_list_of_ids(staff_api_client, permission_manage_menus):
query = """
Expand Down
Loading

0 comments on commit 0b0426f

Please sign in to comment.