Skip to content

Commit

Permalink
#550 Resolve branch inner conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
duker33 committed Sep 7, 2018
1 parent a41d3f6 commit b0d5151
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions shopelectro/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,3 +490,5 @@ def get_robots_content():

PRODUCTS_ON_PAGE_PC = 48
PRODUCTS_ON_PAGE_MOB = 12

PAGINATION_NEIGHBORS = 10
6 changes: 3 additions & 3 deletions shopelectro/tests/tests_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
from django.urls import reverse
from django.utils.translation import ugettext as _

from shopelectro import context
from shopelectro.models import Category, Product, Tag, TagGroup, TagQuerySet
from shopelectro.views.catalog import merge_products_context
from shopelectro.views.service import generate_md5_for_ya_kassa, YANDEX_REQUEST_PARAM


Expand Down Expand Up @@ -82,10 +82,10 @@ def test_merge_product_cache(self):
products = Product.objects.all()[:2]
with self.assertNumQueries(7):
# N db queries without before cached
merge_products_context(products)
context.prepare_tile_products(products)
with self.assertNumQueries(0):
# no db queries after cached
merge_products_context(products)
context.prepare_tile_products(products)


class CatalogTags(BaseCatalogTestCase):
Expand Down
6 changes: 3 additions & 3 deletions shopelectro/views/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ def get(self, request, *args, **kwargs):
return self.render_to_response(context)

def get_context_data(self, **kwargs):
context = super(ProductPage, self).get_context_data(**kwargs)
context_ = super(ProductPage, self).get_context_data(**kwargs)
product = self.object
if not product.page.is_active:
# this context required to render 404 page
# with it's own logic
return context
return context_

return {
**context,
**context_,
'price_bounds': settings.PRICE_BOUNDS,
'group_tags_pairs': product.get_params(),
'tile_products': context.prepare_tile_products(
Expand Down

0 comments on commit b0d5151

Please sign in to comment.