Merge branch 'bug-only_waiting_comments_v2' into 'develop'

bug-only_waiting_comments_v2

See merge request gm/gm-backend!256
This commit is contained in:
Олег Хаятов 2020-02-03 09:00:25 +00:00
commit 33942b70b5
2 changed files with 5 additions and 2 deletions

View File

@ -17,7 +17,7 @@ class CommentLstView(generics.ListCreateAPIView):
"establishment": Establishment.__name__.lower()
}
qs = models.Comment.objects.with_base_related()
qs = models.Comment.objects.with_base_related().filter(status=models.Comment.WAITING)
if "object" in self.kwargs:
qs = qs.by_object_id(self.kwargs["object"])

View File

@ -52,7 +52,10 @@ def parse_cookies(get_response):
# processing country country cookie
country_code = get_country_code(cookie_dict)
request.country_code = country_code
if country_code and country_code != 'None':
request.country_code = country_code
else:
request.country_code = None
response = get_response(request)
return response