finished food view

This commit is contained in:
smilerz
2021-08-31 12:57:25 -05:00
parent 52abba1f16
commit 65fbbabec5
22 changed files with 430 additions and 155454 deletions

View File

@ -242,6 +242,9 @@ class TreeMixin(MergeMixin, FuzzyFilterMixin):
except (PathOverflow, InvalidMoveToDescendant, InvalidPosition):
content = {'error': True, 'msg': _('An error occurred attempting to move ') + child.name}
return Response(content, status=status.HTTP_400_BAD_REQUEST)
elif parent == child.id:
content = {'error': True, 'msg': _('Cannot move an object to itself!')}
return Response(content, status=status.HTTP_403_FORBIDDEN)
try:
parent = self.model.objects.get(pk=parent, space=self.request.space)