diff --git a/core/management/commands/fix_online_ebooks.py b/core/management/commands/fix_online_ebooks.py index 0c45ac8e..30fda49a 100644 --- a/core/management/commands/fix_online_ebooks.py +++ b/core/management/commands/fix_online_ebooks.py @@ -2,7 +2,7 @@ from django.core.management.base import BaseCommand from regluit.core.loaders.doab_utils import online_to_download from regluit.core.models import Ebook -from regluit.core.loader import type_for_url +from regluit.core.models.loader import type_for_url class Command(BaseCommand): help = "fix 'online' ebooks" diff --git a/core/models/__init__.py b/core/models/__init__.py index 13e1703e..296bb9d1 100755 --- a/core/models/__init__.py +++ b/core/models/__init__.py @@ -1198,9 +1198,8 @@ class UserProfile(models.Model): # there should be only one active account per user accounts = self.user.account_set.filter(date_deactivated__isnull=True) if accounts.exists(): - return None - else: return accounts[0] + return None @property def old_account(self):