Browse Source

Corrige alguns erros de import e requirements

Signed-off-by: Luciano Almeida <lucianoalmeida@interlegis.leg.br>
pull/6/head
Luciano Almeida 9 years ago
committed by Luciano Almeida
parent
commit
7617d1de74
  1. 21
      requirements/requirements.txt
  2. 20
      sigi/apps/usuarios/forms.py
  3. 5
      sigi/apps/usuarios/views.py
  4. 17
      sigi/settings/base.py

21
requirements/requirements.txt

@ -1,12 +1,25 @@
-e git://github.com/marinho/geraldo.git@868ebdce67176d9b6205cddc92476f642c783fff#egg=geraldo -e git://github.com/marinho/geraldo.git@868ebdce67176d9b6205cddc92476f642c783fff#egg=geraldo
django-bootstrap3==7.0.1
django-admin-bootstrapped==2.5.7 django-admin-bootstrapped==2.5.7
django-auth-ldap==1.2.8 django-auth-ldap==1.2.8
django-autoslug==1.9.3 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-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-image-cropping==1.0.3
django-localflavor==1.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 Django==1.9.6
libsass==0.11.0
easy-thumbnails==2.3 easy-thumbnails==2.3
eav-django==1.4.7 eav-django==1.4.7
gunicorn==19.6.0 gunicorn==19.6.0
@ -14,10 +27,14 @@ html5lib==0.9999999
Pillow==3.2.0 Pillow==3.2.0
pisa==3.0.33 pisa==3.0.33
psycopg2==2.6.1 psycopg2==2.6.1
python-decouple==3.0
python-memcached==1.58 python-memcached==1.58
pytz==2016.3
PyYAML==3.11 PyYAML==3.11
reportlab==3.3.0 reportlab==2.7
requests==2.10.0 requests==2.10.0
rtyaml==0.0.2
unipath==1.1
six==1.10.0 six==1.10.0
djangorestframework==2.4.8 djangorestframework==2.4.8
django-ipware==1.1.6 django-ipware==1.1.6

20
sigi/apps/usuarios/forms.py

@ -6,19 +6,13 @@ from captcha.fields import CaptchaField
from crispy_forms.helper import FormHelper from crispy_forms.helper import FormHelper
from crispy_forms.layout import Fieldset, Layout, Submit from crispy_forms.layout import Fieldset, Layout, Submit
from django import forms from django import forms
from django.conf import settings
from django.contrib.auth.forms import (AuthenticationForm, PasswordResetForm, from django.contrib.auth.forms import (AuthenticationForm, PasswordResetForm,
SetPasswordForm) SetPasswordForm)
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.contrib.auth.password_validation import validate_password 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.exceptions import ValidationError
from django.core.mail import send_mail
from django.core.urlresolvers import reverse
from django.db import transaction from django.db import transaction
from django.forms import ModelForm 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 _ 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.crud.utils import YES_NO_CHOICES
from sigi.apps.crispy_layout_mixin import form_actions from sigi.apps.crispy_layout_mixin import form_actions
from .models import Telefone, Usuario, ConfirmaEmail from .models import Telefone, Usuario
class LoginForm(AuthenticationForm): class LoginForm(AuthenticationForm):
@ -319,11 +313,11 @@ class HabilitarEditForm(ModelForm):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(HabilitarEditForm, self).__init__(*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'nome_completo', 4),
(u'cpf', 4), (u'cpf', 4),
(u'email', 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 = FormHelper()
self.helper.layout = Layout( self.helper.layout = Layout(
Fieldset( Fieldset(
@ -379,10 +373,10 @@ class MudarSenhaForm(ModelForm):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(MudarSenhaForm, self).__init__(*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', 6),
(u'password_confirm', 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 = FormHelper()
self.helper.layout = Layout( self.helper.layout = Layout(
Fieldset( Fieldset(
@ -401,7 +395,7 @@ class RecuperarSenhaEmailForm(PasswordResetForm):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(RecuperarSenhaEmailForm, self).__init__(*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)]) [(u'email', 6)])
self.helper = FormHelper() self.helper = FormHelper()
self.helper.layout = Layout( self.helper.layout = Layout(
@ -433,7 +427,7 @@ class RecuperacaoMudarSenhaForm(SetPasswordForm):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(RecuperacaoMudarSenhaForm, self).__init__(*args, **kwargs) super(RecuperacaoMudarSenhaForm, self).__init__(*args, **kwargs)
self.fields[u'new_password1'].help_text = u'' 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_password1', 6),
(u'new_password2', 6)]) (u'new_password2', 6)])
self.helper = FormHelper() self.helper = FormHelper()

5
sigi/apps/usuarios/views.py

@ -7,7 +7,6 @@ from django.contrib.auth.mixins import LoginRequiredMixin
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.utils import timezone from django.utils import timezone
from django.views.generic import DetailView, FormView, TemplateView from django.views.generic import DetailView, FormView, TemplateView
import sigi.apps.crud.base
from django.core.mail import send_mail from django.core.mail import send_mail
from sigi.apps.crud.utils import str2bool from sigi.apps.crud.utils import str2bool
from django.contrib.auth.tokens import default_token_generator 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], url_base = full_url[0][:full_url[0].find(u'usuario') - 1],
mensagem = (u"Este e-mail foi utilizado para fazer cadastro no " + mensagem = (u"Este e-mail foi utilizado para fazer cadastro no " +
u"Sistema de Atendimento ao Usuário do Interlegis.\n" + u"Sistema de Atendimento ao Usuário do Interlegis.\n" +
u"Caso você não tenha feito este cadastro, por favor " + u"Caso você não tenha feito este cadastro, por favor" +
u"ignore esta mensagem.\n" + url_base[0] + u" ignore esta mensagem.\n" + url_base[0] +
reverse(u'usuarios:confirmar_email', kwargs=kwargs)) reverse(u'usuarios:confirmar_email', kwargs=kwargs))
remetente = settings.EMAIL_HOST_USER remetente = settings.EMAIL_HOST_USER
destinatario = [confirmar_email.email, destinatario = [confirmar_email.email,

17
sigi/settings/base.py

@ -129,6 +129,12 @@ STATIC_URL = '/static/'
STATICFILES_DIRS = ( STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'sigiStatic'), 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' SERVER_EMAIL = 'sigi@interlegis.leg.br'
DEFAULT_FROM_EMAIL = 'spdt@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_TEMPLATE_PACK = 'bootstrap3'
CRISPY_ALLOWED_TEMPLATE_PACKS = 'bootstrap3' CRISPY_ALLOWED_TEMPLATE_PACKS = 'bootstrap3'
CRISPY_FAIL_SILENTLY = False CRISPY_FAIL_SILENTLY = False

Loading…
Cancel
Save