Before upgrading from 1.7 to 1.8, I ran into a Django ValidationError. I searched for this error but no luck.
The error occurs when https://github.com/django/django/blob/master/django%2Fdb%2Fmodels%2Ffields%2F__init__.py#L958
any help really appreciates this.
Django Version: 1.8.3 Exception Type: ValidationError Exception Value: [u"'xyz' value must be an integer."]
tracking
Traceback: File "django/v1_8/core/handlers/base.py" in get_response 116. response = middleware_method(request) File "/local_middleware.py" in process_request 49. admin = request.user.groups.filter(name='admin') File "django/v1_8/utils/functional.py" in inner 226. self._setup() File "django/v1_8/utils/functional.py" in _setup 359. self._wrapped = self._setupfunc() File "django/v1_8/contrib/auth/middleware.py" in <lambda> 22. request.user = SimpleLazyObject(lambda: get_user(request)) File "django/v1_8/contrib/auth/middleware.py" in get_user 10. request._cached_user = auth.get_user(request) File "django/v1_8/contrib/auth/__init__.py" in get_user 167. user_id = _get_user_session_key(request) File "django/v1_8/contrib/auth/__init__.py" in _get_user_session_key 59. return get_user_model()._meta.pk.to_python(request.session[SESSION_KEY]) File "django/v1_8/db/models/fields/__init__.py" in to_python 969. params={'value': value}, Exception Type: ValidationError at / Exception Value: [u"'xyz' value must be an integer."]
in detail
django/v1_8/db/models/fields/__init__.py in to_python return value try: return int(value) except (TypeError, ValueError): raise exceptions.ValidationError( self.error_messages['invalid'], code='invalid', params={'value': value}, ... ) def validate(self, value, model_instance): pass def get_db_prep_value(self, value, connection, prepared=False): django/v1_8/contrib/auth/middleware.py in <lambda> def process_request(self, request): assert hasattr(request, 'session'), ( "The Django authentication middleware requires session middleware " "to be installed. Edit your MIDDLEWARE_CLASSES setting to insert " "'django.contrib.sessions.middleware.SessionMiddleware' before " "'django.contrib.auth.middleware.AuthenticationMiddleware'." ) request.user = SimpleLazyObject(lambda: get_user(request)) ... class SessionAuthenticationMiddleware(object): """ Formerly, a middleware for invalidating a user sessions that don't correspond to the user current session authentication hash. However, it
source share