fix extend guide method

This commit is contained in:
Anatoly 2020-02-04 18:10:39 +03:00
parent e7759ada27
commit c68d6ec148
2 changed files with 3 additions and 3 deletions

View File

@ -875,7 +875,7 @@ class GuideElementManager(models.Manager):
parent_node = parent_node_qs.first()
return self.get_or_create(guide_element_type=guide_element_type_qs.first(),
parent=parent_node,
guide=parent_node.get_root().guide)
guide=parent_node.parent.guide)
return None, False
def get_or_create_establishment_node(self, restaurant_section_node_id: int,

View File

@ -765,7 +765,7 @@ class EstablishmentGuideCreateDestroyView(generics.GenericAPIView):
# Perform the lookup filtering.
lookup_url_kwarg = getattr(self, 'establishment_lookup_url_kwarg', None)
assert lookup_url_kwarg and lookup_url_kwarg in self.kwargs, (
assert lookup_url_kwarg in self.kwargs, (
'Expected view %s to be called with a URL keyword argument '
'named "%s". Fix your URL conf, or set the `.lookup_field` '
'attribute on the view correctly.' %
@ -786,7 +786,7 @@ class EstablishmentGuideCreateDestroyView(generics.GenericAPIView):
# Perform the lookup filtering.
lookup_url_kwarg = getattr(self, 'guide_lookup_url_kwarg', None)
assert lookup_url_kwarg and lookup_url_kwarg in self.kwargs, (
assert lookup_url_kwarg in self.kwargs, (
'Expected view %s to be called with a URL keyword argument '
'named "%s". Fix your URL conf, or set the `.lookup_field` '
'attribute on the view correctly.' %