Skip to content

Commit

Permalink
Self-review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemijRodionov committed Nov 3, 2018
1 parent e909cd7 commit d0cb865
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
5 changes: 1 addition & 4 deletions catalog/context/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
from .products import Products
from .tags import Tags

# @todo #183:120m Implement Template and PaginatedProducts context classes.
# @todo #183:120m Implement Page, PaginatedProducts, ProductBrands, ProductsImages context classes.
4 changes: 2 additions & 2 deletions catalog/context/products.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.db.models import QuerySet

from catalog.context.context import Products, Tags, Category
from catalog.context.context import Products, Tags
from catalog.models import AbstractCategory


Expand All @@ -29,7 +29,7 @@ def qs(self):
def context(self):
return {
**super().context(),
'sorting_index': _sorting_index,
'sorting_index': self._sorting_index,
}


Expand Down
7 changes: 3 additions & 4 deletions catalog/context/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ class ParsedTags(Tags):

def __init__(self, tags: Tags, req_kwargs):
self._tags = tags
self._req_kwargs = req_kwargs
self._raw_tags = req_kwargs.get('tags')

def qs(self):
raw_tags = self._kwargs.get('tags')
if not raw_tags:
if not self._raw_tags:
self._tags.none()
return self._tags.parsed(raw_tags)
return self._tags.parsed(self._raw_tags)


class Checked404Tags(Tags):
Expand Down

0 comments on commit d0cb865

Please sign in to comment.