diff --git a/sapl/base/models.py b/sapl/base/models.py index 033812735..15e14e39c 100644 --- a/sapl/base/models.py +++ b/sapl/base/models.py @@ -184,7 +184,8 @@ class AppConfig(models.Model): config = AppConfig.objects.first() if not config: - return '' + config = AppConfig() + config.save() return getattr(config, attr) diff --git a/sapl/materia/tests/test_materia.py b/sapl/materia/tests/test_materia.py index c7a773a9c..a538cfb87 100644 --- a/sapl/materia/tests/test_materia.py +++ b/sapl/materia/tests/test_materia.py @@ -1,9 +1,9 @@ -import pytest from django.contrib.auth import get_user_model from django.contrib.contenttypes.models import ContentType from django.core.files.uploadedfile import SimpleUploadedFile from django.core.urlresolvers import reverse from model_mommy import mommy +import pytest from sapl.base.models import Autor, TipoAutor from sapl.comissoes.models import Comissao, TipoComissao diff --git a/sapl/rules/apps.py b/sapl/rules/apps.py index b16f45905..3b6e9d271 100644 --- a/sapl/rules/apps.py +++ b/sapl/rules/apps.py @@ -127,7 +127,7 @@ def create_proxy_permissions( def update_groups(app_config, verbosity=2, interactive=True, - using=DEFAULT_DB_ALIAS, cria_usuarios_padrao=True, + using=DEFAULT_DB_ALIAS, cria_usuarios_padrao=False, **kwargs): if app_config != AppConfig and not isinstance(app_config, AppConfig):