diff --git a/sigi/apps/contatos/migrations/0003_auto_20160623_0829.py b/sigi/apps/contatos/migrations/0003_auto_20160623_0829.py new file mode 100644 index 0000000..8508c79 --- /dev/null +++ b/sigi/apps/contatos/migrations/0003_auto_20160623_0829.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-23 08:29 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('contatos', '0002_auto_20151104_0810'), + ] + + operations = [ + migrations.AlterField( + model_name='contato', + name='email', + field=models.EmailField(blank=True, max_length=254, verbose_name='e-mail'), + ), + ] diff --git a/sigi/apps/home/urls.py b/sigi/apps/home/urls.py index 33e1e5b..2d6b091 100644 --- a/sigi/apps/home/urls.py +++ b/sigi/apps/home/urls.py @@ -1,15 +1,23 @@ # coding: utf-8 from django.conf.urls import patterns, url +from django.views.generic.base import TemplateView -urlpatterns = patterns('sigi.apps.home.views', +urlpatterns = patterns( + 'sigi.apps.home.views', + url(r'^home/atendimento', TemplateView.as_view( + template_name='index_atendimento.html'), + name='index_atendimento'), url(r'^$', 'index', name='sigi_index'), - url(r'^home/resumoconvenios/$', 'resumo_convenios', name="home_resumoconvenios"), + url(r'^home/resumoconvenios/$', 'resumo_convenios', + name="home_resumoconvenios"), url(r'^home/resumoseit/$', 'resumo_seit', name="home_resumoseit"), url(r'^home/chartseit/$', 'chart_seit', name="home_chartseit"), - url(r'^home/chartconvenios/$', 'chart_convenios', name="home_chartconvenios"), + url(r'^home/chartconvenios/$', 'chart_convenios', + name="home_chartconvenios"), url(r'^home/chartcarteira/$', 'chart_carteira', name="home_chartcarteira"), - url(r'^home/chartperformance/$', 'chart_performance', name="home_chartperformance"), - url(r'^home/report/semconvenio/$', 'report_sem_convenio', name="home_reportsemconvenio"), - + url(r'^home/chartperformance/$', 'chart_performance', + name="home_chartperformance"), + url(r'^home/report/semconvenio/$', 'report_sem_convenio', + name="home_reportsemconvenio"), ) diff --git a/sigi/apps/inventario/migrations/0002_auto_20160623_0829.py b/sigi/apps/inventario/migrations/0002_auto_20160623_0829.py new file mode 100644 index 0000000..057c1b3 --- /dev/null +++ b/sigi/apps/inventario/migrations/0002_auto_20160623_0829.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-23 08:29 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('inventario', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='fornecedor', + name='email', + field=models.EmailField(blank=True, max_length=254, verbose_name='e-mail'), + ), + ] diff --git a/sigi/apps/parlamentares/migrations/0002_auto_20160623_0829.py b/sigi/apps/parlamentares/migrations/0002_auto_20160623_0829.py new file mode 100644 index 0000000..56699c4 --- /dev/null +++ b/sigi/apps/parlamentares/migrations/0002_auto_20160623_0829.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-23 08:29 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('parlamentares', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='parlamentar', + name='email', + field=models.EmailField(blank=True, max_length=254, verbose_name='e-mail'), + ), + ] diff --git a/sigi/apps/servicos/migrations/0004_auto_20160623_0829.py b/sigi/apps/servicos/migrations/0004_auto_20160623_0829.py new file mode 100644 index 0000000..7d78bcc --- /dev/null +++ b/sigi/apps/servicos/migrations/0004_auto_20160623_0829.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-23 08:29 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('servicos', '0003_auto_20160616_1602'), + ] + + operations = [ + migrations.AlterField( + model_name='casamanifesta', + name='email', + field=models.EmailField(blank=True, max_length=254, verbose_name='E-mail de contato'), + ), + ] diff --git a/sigi/apps/servidores/migrations/0002_auto_20160623_0829.py b/sigi/apps/servidores/migrations/0002_auto_20160623_0829.py new file mode 100644 index 0000000..cbe7986 --- /dev/null +++ b/sigi/apps/servidores/migrations/0002_auto_20160623_0829.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-23 08:29 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('servidores', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='servidor', + name='email_pessoal', + field=models.EmailField(blank=True, max_length=254, null=True, verbose_name=b'email pessoal'), + ), + ] diff --git a/sigi/apps/solicitacoes/migrations/0003_auto_20160623_0829.py b/sigi/apps/solicitacoes/migrations/0003_auto_20160623_0829.py new file mode 100644 index 0000000..65261cd --- /dev/null +++ b/sigi/apps/solicitacoes/migrations/0003_auto_20160623_0829.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-23 08:29 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('solicitacoes', '0002_auto_20160616_1602'), + ] + + operations = [ + migrations.AlterField( + model_name='solicitacao', + name='email_contato', + field=models.EmailField(blank=True, max_length=254, null=True, verbose_name='Email de contato'), + ), + ] diff --git a/sigi/apps/solicitacoes/urls.py b/sigi/apps/solicitacoes/urls.py index 83f13dd..37c6f6f 100644 --- a/sigi/apps/solicitacoes/urls.py +++ b/sigi/apps/solicitacoes/urls.py @@ -8,6 +8,7 @@ from .apps import AppConfig app_name = AppConfig.name urlpatterns = [ - url(ur'sistema/', include(SistemaCrud.get_urls())), - url(ur'solicitacao/', include(SolicitacaoCrud.get_urls())), + url(ur'home/atendimento/sistema/', include(SistemaCrud.get_urls())), + url(ur'home/atendimento/solicitacao/', + include(SolicitacaoCrud.get_urls())), ] diff --git a/sigi/apps/usuarios/migrations/0004_auto_20160623_0829.py b/sigi/apps/usuarios/migrations/0004_auto_20160623_0829.py new file mode 100644 index 0000000..9c01990 --- /dev/null +++ b/sigi/apps/usuarios/migrations/0004_auto_20160623_0829.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-23 08:29 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('usuarios', '0003_auto_20160616_1602'), + ] + + operations = [ + migrations.AlterField( + model_name='confirmaemail', + name='email', + field=models.EmailField(max_length=254, unique=True, verbose_name='Email'), + ), + migrations.AlterField( + model_name='usuario', + name='email', + field=models.EmailField(max_length=254, unique=True, verbose_name='Email'), + ), + ] diff --git a/sigi/apps/usuarios/urls.py b/sigi/apps/usuarios/urls.py index fdcd9a2..2bb8814 100644 --- a/sigi/apps/usuarios/urls.py +++ b/sigi/apps/usuarios/urls.py @@ -4,11 +4,12 @@ from django.contrib.auth.views import (login, logout, password_reset, password_reset_done, password_reset_confirm, password_reset_complete) -#from atendimento.settings import EMAIL_SEND_USER from sigi.apps.usuarios.forms import (LoginForm, RecuperarSenhaEmailForm, - RecuperacaoMudarSenhaForm) + RecuperacaoMudarSenhaForm) from sigi.apps.usuarios.views import (HabilitarDetailView, HabilitarEditView, - MudarSenhaView, UsuarioCrud, ConfirmarEmailView) + MudarSenhaView, UsuarioCrud, + ConfirmarEmailView) +from django.views.generic.base import TemplateView from .apps import AppConfig @@ -17,7 +18,7 @@ app_name = AppConfig.name EMAIL_SEND_USER='atendimento@interlegis.leg.br' recuperar_email = [ - url(ur'^recuperar/recuperar_senha/$', + url(ur'^home/atendimento/recuperar/recuperar_senha/$', password_reset, {u'template_name': u'usuarios/recuperar_senha.html', u'password_reset_form': RecuperarSenhaEmailForm, @@ -26,35 +27,36 @@ recuperar_email = [ u'from_email': EMAIL_SEND_USER, u'html_email_template_name': u'usuarios/recuperar_senha_email.html'}, name=u'recuperar_senha'), - url(ur'^recuperar/recuperar_recuperar/finalizado/$', + url(ur'^home/atendimento/recuperar/recuperar_recuperar/finalizado/$', password_reset_done, {u'template_name': u'usuarios/recuperar_senha_enviado.html'}, name=u'recuperar_senha_finalizado'), - url(ur'^recuperar/(?P[0-9A-Za-z_\-]+)/(?P.+)/$', + url(ur'^home/atendimento/recuperar/(?P[0-9A-Za-z_\-]+)/(?P.+)/$', password_reset_confirm, {u'post_reset_redirect': u'usuarios:recuperar_senha_completo', u'template_name': u'usuarios/recuperacao_senha_form.html', u'set_password_form': RecuperacaoMudarSenhaForm}, name=u'recuperar_senha_confirma'), - url(ur'^recuperar/completo/$', + url(ur'^home/atendimento/recuperar/completo/$', password_reset_complete, {u'template_name': u'usuarios/recuperacao_senha_completo.html'}, name=u'recuperar_senha_completo'), ] urlpatterns = recuperar_email + [ - url(ur'^login/$', login, { + url(ur'^home/atendimento/login/$', login, { u'template_name': u'usuarios/login.html', u'authentication_form': LoginForm}, name=u'login'), - url(ur'^logout/$', logout, {u'next_page': u'/login'}, name=u'logout'), - url(ur'^usuario/', include(UsuarioCrud.get_urls())), + url(ur'^home/atendimento/logout/$', logout, {u'next_page': u'/login'}, + name=u'logout'), + url(ur'^home/atendimento/usuario/', include(UsuarioCrud.get_urls())), - url(ur'^habilitar/(?P\d+)$', + url(ur'^home/atendimento/habilitar/(?P\d+)$', HabilitarDetailView.as_view(), name=u'habilitar_detail'), - url(ur'^habilitar/(?P\d+)/edit$', + url(ur'^home/atendimento/habilitar/(?P\d+)/edit$', HabilitarEditView.as_view(), name=u'habilitar_edit'), - url(ur'^usuario/(?P\d+)/mudar_senha$', + url(ur'^home/atendimento/usuario/(?P\d+)/mudar_senha$', MudarSenhaView.as_view(), name=u'mudar_senha'), url(ur'^usuario/confirmar/(?P[0-9A-Za-z_\-]+)/(?P[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})$', ConfirmarEmailView.as_view(), name=u'confirmar_email'), diff --git a/sigi/apps/usuarios/views.py b/sigi/apps/usuarios/views.py index 8ea64e1..ee3c869 100644 --- a/sigi/apps/usuarios/views.py +++ b/sigi/apps/usuarios/views.py @@ -55,7 +55,7 @@ class UsuarioCrud(Crud): settings.EMAIL_HOST_USER] send_mail(assunto, mensagem, remetente, destinatario, fail_silently=False) - return reverse(u'home_atendimento') + return reverse(u'index_atendimento') class ListView(LoginRequiredMixin, CrudListView): pass @@ -169,7 +169,7 @@ class MudarSenhaView(FormValidMessageMixin, FormView): return super(MudarSenhaView, self).form_valid(form) def get_success_url(self): - return reverse(u'home') + return reverse(u'index_atendimento') class ConfirmarEmailView(TemplateView): diff --git a/sigi/settings/base.py b/sigi/settings/base.py index 7ff265f..2a29ab1 100644 --- a/sigi/settings/base.py +++ b/sigi/settings/base.py @@ -134,6 +134,16 @@ SERVER_EMAIL = 'sigi@interlegis.leg.br' DEFAULT_FROM_EMAIL = 'spdt@interlegis.leg.br' EMAIL_SUBJECT_PREFIX = u'[SIGI]' + +EMAIL_USE_TLS = True +EMAIL_PORT = 587 +EMAIL_HOST = 'smtp.interlegis.leg.br' +EMAIL_HOST_USER = 'sapl-test' +EMAIL_HOST_PASSWORD = '2BhCwbGHcZ' +EMAIL_SEND_USER = 'atendimento@interlegis.leg.br' +EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' + + TEMPLATE_DIRS = ( os.path.join(BASE_DIR, 'templates'), ) @@ -142,8 +152,10 @@ MEDIA_URL = '/media/' SESSION_EXPIRE_AT_BROWSER_CLOSE = True -LOGIN_REDIRECT_URL = '' -LOGIN_URL = '/login/' +# LOGIN_REDIRECT_URL = '' +# LOGIN_URL = '/login/' +LOGIN_REDIRECT_URL = '/' +LOGIN_URL = '/login/?next=' # Using pytest directly (without a test runner) TEST_RUNNER = None