From e570ad468348bd92f8f4c821a4efa53749dba747 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Thu, 9 Mar 2017 20:13:12 +0100 Subject: [PATCH] use get_user_model() in clean-unused-account command (fixes #15616) --- src/authentic2/management/commands/clean-unused-accounts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/authentic2/management/commands/clean-unused-accounts.py b/src/authentic2/management/commands/clean-unused-accounts.py index ebd0888..d7fdd85 100644 --- a/src/authentic2/management/commands/clean-unused-accounts.py +++ b/src/authentic2/management/commands/clean-unused-accounts.py @@ -2,7 +2,7 @@ from optparse import make_option import logging import datetime -from django.contrib.auth.models import User +from django.contrib.auth import get_user_model from django.core.management.base import BaseCommand, CommandError from django.core.mail import send_mail from django.utils.timezone import now @@ -74,7 +74,7 @@ class Command(BaseCommand): self.from_email = options['from_email'] if self.fake: log.info('fake call to clean-unused-accounts') - users = User.objects.all() + users = get_user_model().objects.all() if options['filter']: for f in options['filter']: key, value = f.split('=', 1) -- 2.1.4