From 7617d1de7448624e52c19dc8f95e4349f6604995 Mon Sep 17 00:00:00 2001 From: Luciano Almeida Date: Tue, 21 Jun 2016 14:48:34 -0300 Subject: [PATCH] Corrige alguns erros de import e requirements Signed-off-by: Luciano Almeida --- requirements/requirements.txt | 21 +++++++++++++++++++-- sigi/apps/usuarios/forms.py | 20 +++++++------------- sigi/apps/usuarios/views.py | 5 ++--- sigi/settings/base.py | 17 ++++++----------- 4 files changed, 34 insertions(+), 29 deletions(-) diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 570c578..694f67b 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -1,12 +1,25 @@ -e git://github.com/marinho/geraldo.git@868ebdce67176d9b6205cddc92476f642c783fff#egg=geraldo -django-bootstrap3==7.0.1 django-admin-bootstrapped==2.5.7 django-auth-ldap==1.2.8 django-autoslug==1.9.3 +django-bootstrap3==7.0.1 +django-bower==5.1.0 +django-braces==1.8.1 +django-compressor==2.0 +django-crispy-forms==1.6.0 +dj-database-url==0.4.1 +django-dotenv==1.4.1 django-extensions==1.6.7 +django-extra-views==0.7.1 +django-filter==0.13.0 +django-floppyforms==1.6.1 django-image-cropping==1.0.3 django-localflavor==1.3 +django-model-utils==2.4 +django-sass-processor==0.3.4 +django-simple-captcha==0.5.1 Django==1.9.6 +libsass==0.11.0 easy-thumbnails==2.3 eav-django==1.4.7 gunicorn==19.6.0 @@ -14,10 +27,14 @@ html5lib==0.9999999 Pillow==3.2.0 pisa==3.0.33 psycopg2==2.6.1 +python-decouple==3.0 python-memcached==1.58 +pytz==2016.3 PyYAML==3.11 -reportlab==3.3.0 +reportlab==2.7 requests==2.10.0 +rtyaml==0.0.2 +unipath==1.1 six==1.10.0 djangorestframework==2.4.8 django-ipware==1.1.6 diff --git a/sigi/apps/usuarios/forms.py b/sigi/apps/usuarios/forms.py index 44ecba2..fa97dbe 100644 --- a/sigi/apps/usuarios/forms.py +++ b/sigi/apps/usuarios/forms.py @@ -6,19 +6,13 @@ from captcha.fields import CaptchaField from crispy_forms.helper import FormHelper from crispy_forms.layout import Fieldset, Layout, Submit from django import forms -from django.conf import settings from django.contrib.auth.forms import (AuthenticationForm, PasswordResetForm, SetPasswordForm) from django.contrib.auth.models import User from django.contrib.auth.password_validation import validate_password -from django.contrib.auth.tokens import default_token_generator from django.core.exceptions import ValidationError -from django.core.mail import send_mail -from django.core.urlresolvers import reverse from django.db import transaction from django.forms import ModelForm -from django.utils.encoding import force_bytes -from django.utils.http import urlsafe_base64_encode from django.utils.translation import ugettext_lazy as _ @@ -26,7 +20,7 @@ import sigi.apps.crispy_layout_mixin from sigi.apps.crud.utils import YES_NO_CHOICES from sigi.apps.crispy_layout_mixin import form_actions -from .models import Telefone, Usuario, ConfirmaEmail +from .models import Telefone, Usuario class LoginForm(AuthenticationForm): @@ -319,11 +313,11 @@ class HabilitarEditForm(ModelForm): def __init__(self, *args, **kwargs): super(HabilitarEditForm, self).__init__(*args, **kwargs) - row1 = crispy_layout_mixin.to_row( + row1 = sigi.apps.crispy_layout_mixin.to_row( [(u'nome_completo', 4), (u'cpf', 4), (u'email', 4)]) - row2 = crispy_layout_mixin.to_row([(u'habilitado', 12)]) + row2 = sigi.apps.crispy_layout_mixin.to_row([(u'habilitado', 12)]) self.helper = FormHelper() self.helper.layout = Layout( Fieldset( @@ -379,10 +373,10 @@ class MudarSenhaForm(ModelForm): def __init__(self, *args, **kwargs): super(MudarSenhaForm, self).__init__(*args, **kwargs) - row1 = crispy_layout_mixin.to_row( + row1 = sigi.apps.crispy_layout_mixin.to_row( [(u'password', 6), (u'password_confirm', 6)]) - row2 = crispy_layout_mixin.to_row([(u'captcha', 12)]) + row2 = sigi.apps.crispy_layout_mixin.to_row([(u'captcha', 12)]) self.helper = FormHelper() self.helper.layout = Layout( Fieldset( @@ -401,7 +395,7 @@ class RecuperarSenhaEmailForm(PasswordResetForm): def __init__(self, *args, **kwargs): super(RecuperarSenhaEmailForm, self).__init__(*args, **kwargs) - row1 = crispy_layout_mixin.to_row( + row1 = sigi.apps.crispy_layout_mixin.to_row( [(u'email', 6)]) self.helper = FormHelper() self.helper.layout = Layout( @@ -433,7 +427,7 @@ class RecuperacaoMudarSenhaForm(SetPasswordForm): def __init__(self, *args, **kwargs): super(RecuperacaoMudarSenhaForm, self).__init__(*args, **kwargs) self.fields[u'new_password1'].help_text = u'' - row1 = crispy_layout_mixin.to_row( + row1 = sigi.apps.crispy_layout_mixin.to_row( [(u'new_password1', 6), (u'new_password2', 6)]) self.helper = FormHelper() diff --git a/sigi/apps/usuarios/views.py b/sigi/apps/usuarios/views.py index bfbbe03..6b90025 100644 --- a/sigi/apps/usuarios/views.py +++ b/sigi/apps/usuarios/views.py @@ -7,7 +7,6 @@ from django.contrib.auth.mixins import LoginRequiredMixin from django.core.urlresolvers import reverse from django.utils import timezone from django.views.generic import DetailView, FormView, TemplateView -import sigi.apps.crud.base from django.core.mail import send_mail from sigi.apps.crud.utils import str2bool from django.contrib.auth.tokens import default_token_generator @@ -45,8 +44,8 @@ class UsuarioCrud(Crud): url_base = full_url[0][:full_url[0].find(u'usuario') - 1], mensagem = (u"Este e-mail foi utilizado para fazer cadastro no " + u"Sistema de Atendimento ao Usuário do Interlegis.\n" + - u"Caso você não tenha feito este cadastro, por favor " + - u"ignore esta mensagem.\n" + url_base[0] + + u"Caso você não tenha feito este cadastro, por favor" + + u" ignore esta mensagem.\n" + url_base[0] + reverse(u'usuarios:confirmar_email', kwargs=kwargs)) remetente = settings.EMAIL_HOST_USER destinatario = [confirmar_email.email, diff --git a/sigi/settings/base.py b/sigi/settings/base.py index 245efff..0759d58 100644 --- a/sigi/settings/base.py +++ b/sigi/settings/base.py @@ -129,6 +129,12 @@ STATIC_URL = '/static/' STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'sigiStatic'), ) +STATICFILES_FINDERS = ( + 'django.contrib.staticfiles.finders.FileSystemFinder', + 'django.contrib.staticfiles.finders.AppDirectoriesFinder', + 'djangobower.finders.BowerFinder', + 'sass_processor.finders.CssFinder', +) SERVER_EMAIL = 'sigi@interlegis.leg.br' DEFAULT_FROM_EMAIL = 'spdt@interlegis.leg.br' @@ -194,17 +200,6 @@ LOGGING = { }, } -STATIC_URL = '/static/' -STATIC_ROOT = os.path.join(BASE_DIR, "collected_static") -STATICFILES_DIRS = (os.path.join(BASE_DIR, ("static")),) -STATICFILES_FINDERS = ( - 'django.contrib.staticfiles.finders.FileSystemFinder', - 'django.contrib.staticfiles.finders.AppDirectoriesFinder', - 'djangobower.finders.BowerFinder', - 'sass_processor.finders.CssFinder', -) - - CRISPY_TEMPLATE_PACK = 'bootstrap3' CRISPY_ALLOWED_TEMPLATE_PACKS = 'bootstrap3' CRISPY_FAIL_SILENTLY = False