Browse Source

ajusta criação de config da app e retorna valor de post_migrate

pull/1642/head
LeandroRoberto 7 years ago
parent
commit
3a59eeb923
  1. 3
      sapl/base/models.py
  2. 2
      sapl/materia/tests/test_materia.py
  3. 2
      sapl/rules/apps.py

3
sapl/base/models.py

@ -184,7 +184,8 @@ class AppConfig(models.Model):
config = AppConfig.objects.first() config = AppConfig.objects.first()
if not config: if not config:
return '' config = AppConfig()
config.save()
return getattr(config, attr) return getattr(config, attr)

2
sapl/materia/tests/test_materia.py

@ -1,9 +1,9 @@
import pytest
from django.contrib.auth import get_user_model from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.core.files.uploadedfile import SimpleUploadedFile from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from model_mommy import mommy from model_mommy import mommy
import pytest
from sapl.base.models import Autor, TipoAutor from sapl.base.models import Autor, TipoAutor
from sapl.comissoes.models import Comissao, TipoComissao from sapl.comissoes.models import Comissao, TipoComissao

2
sapl/rules/apps.py

@ -127,7 +127,7 @@ def create_proxy_permissions(
def update_groups(app_config, verbosity=2, interactive=True, 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): **kwargs):
if app_config != AppConfig and not isinstance(app_config, AppConfig): if app_config != AppConfig and not isinstance(app_config, AppConfig):

Loading…
Cancel
Save