diff --git a/smartmin/models.py b/smartmin/models.py index ed6d295..cc82e1c 100644 --- a/smartmin/models.py +++ b/smartmin/models.py @@ -8,8 +8,13 @@ from django.conf import settings from django.db import models +from django.db.models.signals import post_migrate from django.utils import timezone +from .perms import sync_permissions + +post_migrate.connect(sync_permissions) + class SmartImportRowError(Exception): def __init__(self, message): diff --git a/smartmin/users/perms.py b/smartmin/perms.py similarity index 100% rename from smartmin/users/perms.py rename to smartmin/perms.py diff --git a/smartmin/users/models.py b/smartmin/users/models.py index 2108055..d534e7d 100644 --- a/smartmin/users/models.py +++ b/smartmin/users/models.py @@ -4,13 +4,8 @@ from django.conf import settings from django.contrib.auth.hashers import check_password from django.db import models -from django.db.models.signals import post_migrate from django.utils import timezone -from .perms import sync_permissions - -post_migrate.connect(sync_permissions) - def is_password_complex(password): has_caps = re.search("[A-Z]+", password) diff --git a/test_runner/blog/tests.py b/test_runner/blog/tests.py index 5200c5f..d0f0041 100644 --- a/test_runner/blog/tests.py +++ b/test_runner/blog/tests.py @@ -17,10 +17,10 @@ import smartmin from smartmin.csv_imports.models import ImportTask from smartmin.models import SmartImportRowError +from smartmin.perms import update_group_permissions from smartmin.templatetags.smartmin import get, get_value_from_view, user_as_string, view_as_json from smartmin.tests import SmartminTest from smartmin.users.models import FailedLogin, PasswordHistory, RecoveryToken, is_password_complex -from smartmin.users.perms import update_group_permissions from smartmin.views import smart_url from smartmin.widgets import DatePickerWidget, ImageThumbnailWidget from test_runner.blog.models import Category, Post