juanifioren / django-oidc-provider

OpenID Connect and OAuth2 provider implementation for Djangonauts.
http://django-oidc-provider.readthedocs.org
MIT License
425 stars 239 forks source link

'AnonymousUser' object is not iterable issue. #373

Open pranavkatiyar opened 4 years ago

pranavkatiyar commented 4 years ago

Hi, I am getting the following error randomly.

(I am having 3 different environments running up but this issue is showing up only in one of the environments, the rest two are working fine.)

Traceback (most recent call last): File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response response = wrapped_callback(request, *callback_args, callback_kwargs) File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/views/generic/base.py", line 71, in view return self.dispatch(request, *args, *kwargs) File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/views/generic/base.py", line 97, in dispatch return handler(request, args, kwargs) File "/opt/python/run/venv/local/lib/python3.6/site-packages/oidc_provider/views.py", line 191, in post authorize.set_client_user_consent() File "/opt/python/run/venv/local/lib/python3.6/site-packages/oidc_provider/lib/endpoints/authorize.py", line 245, in set_client_user_consent 'date_given': date_given, File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method return getattr(self.get_queryset(), name)(args, kwargs) File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/db/models/query.py", line 538, in get_or_create return self.get(kwargs), False File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/db/models/query.py", line 399, in get clone = self.filter(args, kwargs) File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/db/models/query.py", line 892, in filter return self._filter_or_exclude(False, *args, *kwargs) File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/db/models/query.py", line 910, in _filter_or_exclude clone.query.add_q(Q(args, kwargs)) File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/db/models/sql/query.py", line 1290, in addq clause, = self._add_q(q_object, self.used_aliases) File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/db/models/sql/query.py", line 1318, in _add_q split_subq=split_subq, simple_col=simple_col, File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/db/models/sql/query.py", line 1224, in build_filter self.check_related_objects(join_info.final_field, value, join_info.opts) File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/db/models/sql/query.py", line 1086, in check_related_objects for v in value: File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/utils/functional.py", line 257, in inner return func(self._wrapped, *args) TypeError: 'AnonymousUser' object is not iterable