diff --git a/django/contrib/auth/handlers/modwsgi.py b/django/contrib/auth/handlers/modwsgi.py index 198d9c0139..591ec72cb4 100644 --- a/django/contrib/auth/handlers/modwsgi.py +++ b/django/contrib/auth/handlers/modwsgi.py @@ -1,6 +1,5 @@ from django import db from django.contrib import auth -from django.utils.encoding import force_bytes UserModel = auth.get_user_model() @@ -39,6 +38,6 @@ def groups_for_user(environ, username): return [] if not user.is_active: return [] - return [force_bytes(group.name) for group in user.groups.all()] + return [group.name.encode() for group in user.groups.all()] finally: db.close_old_connections()