From 3a59eeb92359a036da33902e0d18a0006c4d7acf Mon Sep 17 00:00:00 2001 From: LeandroRoberto Date: Fri, 8 Dec 2017 13:54:22 -0200 Subject: [PATCH] =?UTF-8?q?ajusta=20cria=C3=A7=C3=A3o=20de=20config=20da?= =?UTF-8?q?=20app=20e=20retorna=20valor=20de=20post=5Fmigrate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/base/models.py | 3 ++- sapl/materia/tests/test_materia.py | 2 +- sapl/rules/apps.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) 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):