|
@ -17,6 +17,7 @@ from django.core.exceptions import ObjectDoesNotExist |
|
|
from django.db import connections, transaction |
|
|
from django.db import connections, transaction |
|
|
from django.db.models import Count, Max |
|
|
from django.db.models import Count, Max |
|
|
from django.db.models.base import ModelBase |
|
|
from django.db.models.base import ModelBase |
|
|
|
|
|
from pytz import timezone |
|
|
|
|
|
|
|
|
from sapl.base.models import AppConfig as AppConf |
|
|
from sapl.base.models import AppConfig as AppConf |
|
|
from sapl.base.models import (Autor, ProblemaMigracao, TipoAutor, |
|
|
from sapl.base.models import (Autor, ProblemaMigracao, TipoAutor, |
|
@ -575,8 +576,11 @@ class DataMigrator: |
|
|
sigla_casa = match.group(1) |
|
|
sigla_casa = match.group(1) |
|
|
with open(os.path.expanduser('~/sapl_dumps/tabela_timezones.yaml'), 'r') as arq: |
|
|
with open(os.path.expanduser('~/sapl_dumps/tabela_timezones.yaml'), 'r') as arq: |
|
|
tabela_timezones = yaml.load(arq) |
|
|
tabela_timezones = yaml.load(arq) |
|
|
municipio, uf = tabela_timezones[sigla_casa] |
|
|
municipio, uf, nome_timezone = tabela_timezones[sigla_casa] |
|
|
self.timezone = get_timezone(municipio, uf) |
|
|
if nome_timezone: |
|
|
|
|
|
self.timezone = timezone(nome_timezone) |
|
|
|
|
|
else: |
|
|
|
|
|
self.timezone = get_timezone(municipio, uf) |
|
|
|
|
|
|
|
|
def populate_renamed_fields(self, new, old): |
|
|
def populate_renamed_fields(self, new, old): |
|
|
renames = self.field_renames[type(new)] |
|
|
renames = self.field_renames[type(new)] |
|
|