AnonymousUser iteration at /boutique/order/edit
TypeError at /boutique/order/edit
'AnonymousUser' object is not iterable
Traceback
File "/home/sde/prod/.venv/lib/python3.8/site-packages/django/core/handlers/exception.py" in inner
34. response = get_response(request)
File "/home/sde/prod/.venv/lib/python3.8/site-packages/django/core/handlers/base.py" in _get_response
115. response = self.process_exception_by_middleware(e, request)
File "/home/sde/prod/.venv/lib/python3.8/site-packages/django/core/handlers/base.py" in _get_response
113. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/sde/prod/.venv/lib/python3.8/site-packages/django/views/generic/base.py" in view
65. self.setup(request, *args, **kwargs)
File "./boutique/views.py" in setup
332. if self.get_object().clean_illegal_items():
File "./boutique/views.py" in get_object
326. return self.model.objects.get_current_order(self.request.user)
File "./boutique/models.py" in get_current_order
241. order, _ = self.get_or_create(user=user, ordered=False)
File "/home/sde/prod/.venv/lib/python3.8/site-packages/django/db/models/manager.py" in manager_method
82. return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/sde/prod/.venv/lib/python3.8/site-packages/django/db/models/query.py" in get_or_create
538. return self.get(**kwargs), False
File "/home/sde/prod/.venv/lib/python3.8/site-packages/django/db/models/query.py" in get
399. clone = self.filter(*args, **kwargs)
File "/home/sde/prod/.venv/lib/python3.8/site-packages/django/db/models/query.py" in filter
892. return self._filter_or_exclude(False, *args, **kwargs)
File "/home/sde/prod/.venv/lib/python3.8/site-packages/django/db/models/query.py" in _filter_or_exclude
910. clone.query.add_q(Q(*args, **kwargs))
File "/home/sde/prod/.venv/lib/python3.8/site-packages/django/db/models/sql/query.py" in add_q
1290. clause, _ = self._add_q(q_object, self.used_aliases)
File "/home/sde/prod/.venv/lib/python3.8/site-packages/django/db/models/sql/query.py" in _add_q
1315. child_clause, needed_inner = self.build_filter(
File "/home/sde/prod/.venv/lib/python3.8/site-packages/django/db/models/sql/query.py" in build_filter
1224. self.check_related_objects(join_info.final_field, value, join_info.opts)
File "/home/sde/prod/.venv/lib/python3.8/site-packages/django/db/models/sql/query.py" in check_related_objects
1086. for v in value:
File "/home/sde/prod/.venv/lib/python3.8/site-packages/django/utils/functional.py" in inner
257. return func(self._wrapped, *args)
Exception Type: TypeError at /boutique/order/edit
Exception Value: 'AnonymousUser' object is not iterable
Occurence 1:
HTTP_FROM = 'googlebot(at)googlebot.com'
HTTP_USER_AGENT = 'Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.90 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'
Occurence 2:
HTTP_USER_AGENT = 'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)'