Skip to content
Snippets Groups Projects
Commit daf5dc3f authored by Patricio Kumagae's avatar Patricio Kumagae
Browse files

Actualización desde gitlab.bora.local

parent 376c9b57
No related branches found
No related tags found
No related merge requests found
......@@ -25,12 +25,13 @@ DEFAULT_FROM_EMAIL = 'no-reply@bfa.ar'
ADMIN_EMAIL = 'no-reply@bfa.ar'
# NODO DE BLOACJAJEICHAIN
NODE_URL = 'http://10.23.10.73:54450' # salberchain
NODE_URL = 'http://10.23.10.71:8501' # salberchain
DISTILLERY_ADDRESS = '0x9Da2aC818d39f4342f67eC94F86865A34b642342' # distillery
DISTRIBUTOR_ACCOUNT = '0xc9cec0B3fbb502B2eF4d03eBf6a1A612CBdE53E3' # cuenta con mucho ether, vive en el 72
# 0x21ea59FC5cE54a827E20BC9b736FeeD8F9C880Ff
# CFG BLOCKCHANGE
DISTILLERY_ADDRESS = '0x822c2b518dCfEE69d435E0C5F2e6d196FcC8320E' # distillery
DISTRIBUTOR_ACCOUNT = '0xA9cAc6C2EF4909A05eF24A12Ecadf9E541B5995F' # cuenta con mucho ether con su clave privada en
# el 10.23.10.73
# cuentas para pruebas: 0xd57c1f52ff4513c721bd22ccbee55b7cef440b5c y 0x6664e892a36e74e1e618b9bfb25caa0f18b311a4
# passphrase prueba para ambas cuentas
......
{#
Copyright 2019 de la Dirección General de Sistemas Informáticos – Secretaría Legal y Técnica - Nación.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/
#}
{% autoescape off %}
Se ha registrado un nuevo usuario en la aplicación Poppins
Usuario: {{ name }}
......
......@@ -47,26 +47,26 @@
</div>
<div class="form-group form-group-lg col-sm-12">
<label for="email" class="form-required">Correo electrónico</label>
<input class="form-control" type="text" id="email" name="email" value="{{ user.email }}" size="60" maxlength="255" required="required" aria-required="true">
<input class="form-control" type="text" id="email" name="email" value="{{ user.email }}" size="60" maxlength="255" required="required" aria-required="true" disabled>
</div>
<div class="form-group form-group-lg col-sm-12">
<a href="/change_password/">Cambiar contraseña</a>
</div>
<div class="form-group form-group-lg col-sm-12">
<label for="cuit">CUIT</label>
<input class="form-control" type="text" id="cuit" name="cuit" value="{{ custom_user.cuit|default_if_none:"" }}" size="60" maxlength="13">
<input class="form-control" type="text" id="cuit" name="cuit" value="{{ custom_user.cuit|default_if_none:"" }}" size="60" maxlength="13" disabled>
</div>
<div class="form-group form-group-lg col-sm-12">
<label for="org">Organización</label>
<input class="form-control" type="text" id="organization" name="organization" value="{{ custom_user.organization|default_if_none:"" }}" size="60" maxlength="255">
<input class="form-control" type="text" id="organization" name="organization" value="{{ custom_user.organization|default_if_none:"" }}" size="60" maxlength="255" disabled>
</div>
<div class="form-group form-group-lg col-sm-12">
<label for="rol">Rol</label>
<input class="form-control" type="text" id="rol" name="rol" value="{{ custom_user.rol|default_if_none:"" }}" size="60" maxlength="255">
<input class="form-control" type="text" id="rol" name="rol" value="{{ custom_user.rol|default_if_none:"" }}" size="60" maxlength="255" disabled>
</div>
<div class="form-group form-group-lg col-sm-12">
<label for="sector">Sector</label>
<select name="section" id="section" class="form-control">
<select name="section" id="section" class="form-control" disabled>
<option value="">Seleccione un sector</option>
{% for section in sections %}
<option value="{{ section.id }}" {% if section.id == custom_user.section_id %}selected="selected"{% endif %}>{{ section.name }}</option>
......
......@@ -17,9 +17,9 @@ from django.http import HttpResponseRedirect
from django.http.response import JsonResponse
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.views import LoginView
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.core.validators import validate_email
from django.core.exceptions import ValidationError
from django.contrib import messages
from django.utils.translation import ugettext as _
from django.db import transaction, IntegrityError
......@@ -334,8 +334,6 @@ class CaptchaLoginView(LoginView):
form = self.get_form()
if form.is_valid():
return self.form_valid(form)
''' Begin reCAPTCHA validation '''
recaptcha_response = request.POST.get('g-recaptcha-response')
data = {
......@@ -394,20 +392,41 @@ def update_user(request):
else:
try:
email_changed = False
with transaction.atomic():
user.first_name = request.POST['first_name']
user.last_name = request.POST['last_name']
user.email = request.POST['email']
# Tarea #18822 - [BFA-registro] Campo mail - Readonly - INICIO
#validate_email(request.POST['email'])
# Tarea #18822 - [BFA-registro] Campo mail - Readonly - FIN
# Cambio para tener que validar la cuenta cuando se cambia el mail. Queda para el futuro
# if user.email != request.POST['email']:
# user.is_active = False
# send_email_changed_email(request, request.POST['email'])
# email_changed = True
# Fin
# Tarea #18822 - [BFA-registro] Campo mail - Readonly - INICIO
#user.email = request.POST['email']
# Tarea #18822 - [BFA-registro] Campo mail - Readonly - FIN
user.save()
custom_user.cuit = request.POST['cuit']
custom_user.organization = request.POST['organization']
custom_user.rol = request.POST['rol']
custom_user.section_id = request.POST['section']
custom_user.save()
# Tarea #18590 - [BFA-registro] bloquear edición de campos en front-end - INICIO
#
# custom_user.cuit = request.POST['cuit']
# custom_user.organization = request.POST['organization']
# custom_user.rol = request.POST['rol']
# custom_user.section_id = request.POST['section']
# custom_user.save()
# Tarea #18590 - [BFA-registro] bloquear edición de campos en front-end - FIN
messages.success(request, _('user_updated'))
except ValidationError as e:
messages.error(request, str(e.messages[0]), extra_tags='danger')
except Exception as e:
messages.error(request, _('user_update_error'), extra_tags='danger')
client.captureException()
......@@ -416,6 +435,33 @@ def update_user(request):
return HttpResponseRedirect('/mis_datos/')
def send_email_changed_email(request, new_email):
try:
r = RegistrationView()
activation_key = r.get_activation_key(request.user)
context = {}
context['user'] = request.user
context['activation_key'] = activation_key
context['scheme'] = 'https' if request.is_secure() else 'http'
context['site'] = get_current_site(request)
message = render_to_string(
template_name='django_registration/email_changed_body.html',
context=context,
request=request
)
request.user.email = new_email
request.user.email_user(_('email_changed_subject'), message, settings.DEFAULT_FROM_EMAIL, html_message=message)
except Exception as e:
client.captureException()
logger.error(str(e))
raise
@login_required(login_url='/accounts/login/')
def change_password(request):
if request.method == 'GET':
......
No preview for this file type
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-01-31 11:11-0300\n"
"POT-Creation-Date: 2019-04-04 12:03-0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -18,7 +18,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: Poppins/settings.py:127
#: Poppins/settings.py:130
msgid "Spanish"
msgstr ""
......@@ -95,7 +95,7 @@ msgstr ""
msgid "no_se_encontraron_cuentas"
msgstr ""
#: frontend/templates/dapp/account_list.html:212
#: frontend/templates/dapp/account_list.html:234
msgid "no_se_encontraron_cuentas_existentes"
msgstr ""
......@@ -143,71 +143,79 @@ msgstr ""
msgid "password_reset_complete"
msgstr ""
#: frontend/views.py:72 frontend/views.py:344
#: frontend/views.py:71 frontend/views.py:352
msgid "invalid_captcha"
msgstr "No reCAPTCHA"
#: frontend/views.py:98
#: frontend/views.py:97
msgid "error_register"
msgstr ""
#: frontend/views.py:176
#: frontend/views.py:179
msgid "account_added"
msgstr ""
#: frontend/views.py:178
#: frontend/views.py:184
msgid "existing_account"
msgstr ""
#: frontend/views.py:180
#: frontend/views.py:186
msgid "address_not_valid"
msgstr ""
#: frontend/views.py:183 frontend/views.py:185 frontend/views.py:188
#: frontend/views.py:240 frontend/views.py:243
#: frontend/views.py:190 frontend/views.py:193 frontend/views.py:198
#: frontend/views.py:248 frontend/views.py:253
msgid "error_create_view"
msgstr ""
#: frontend/views.py:183
#: frontend/views.py:190
msgid "existing_service"
msgstr ""
#: frontend/views.py:235
#: frontend/views.py:243
msgid "existing_account_added"
msgstr ""
#: frontend/views.py:238
#: frontend/views.py:246
msgid "user_already_has_account"
msgstr ""
#: frontend/views.py:286
#: frontend/views.py:294 logica_cuentas/services.py:117
msgid "cuenta_borrada"
msgstr ""
#: frontend/views.py:290
#: frontend/views.py:298 logica_cuentas/services.py:121
msgid "cuenta_desvinculada"
msgstr ""
#: frontend/views.py:293
#: frontend/views.py:301
msgid "error_borrar_cuenta"
msgstr ""
#: frontend/views.py:305
#: frontend/views.py:313
msgid "ether_solicitado"
msgstr ""
#: frontend/views.py:308
#: frontend/views.py:316
msgid "error_peticion_ether"
msgstr ""
#: frontend/views.py:403
#: frontend/views.py:427
msgid "email_changed"
msgstr ""
#: frontend/views.py:429
msgid "user_updated"
msgstr ""
#: frontend/views.py:405
#: frontend/views.py:433
msgid "user_update_error"
msgstr ""
#: frontend/views.py:420
#: frontend/views.py:460
msgid "email_changed_subject"
msgstr ""
#: frontend/views.py:476
msgid "password_changed"
msgstr ""
No preview for this file type
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-01-31 11:11-0300\n"
"POT-Creation-Date: 2019-04-04 12:03-0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -18,7 +18,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: Poppins/settings.py:127
#: Poppins/settings.py:130
msgid "Spanish"
msgstr ""
......@@ -95,7 +95,7 @@ msgstr "Cuentas"
msgid "no_se_encontraron_cuentas"
msgstr "Todavía no tenés cuentas asociadas a tu usuario."
#: frontend/templates/dapp/account_list.html:212
#: frontend/templates/dapp/account_list.html:234
msgid "no_se_encontraron_cuentas_existentes"
msgstr "No se encontraron cuentas existentes para agregar"
......@@ -143,73 +143,83 @@ msgstr "¿Olvidaste tu contraseña?"
msgid "password_reset_complete"
msgstr "Tu contraseña ha sido cambiada"
#: frontend/views.py:72 frontend/views.py:344
#: frontend/views.py:71 frontend/views.py:352
msgid "invalid_captcha"
msgstr "Completá el captcha"
#: frontend/views.py:98
#: frontend/views.py:97
msgid "error_register"
msgstr "Ocurrió un error al realizar el registro"
#: frontend/views.py:176
#: frontend/views.py:179
msgid "account_added"
msgstr "Cuenta %s agregada"
#: frontend/views.py:178
#: frontend/views.py:184
msgid "existing_account"
msgstr "La cuenta %s ya se encuentra registrada"
#: frontend/views.py:180
#: frontend/views.py:186
msgid "address_not_valid"
msgstr "La dirección %s no es válida"
#: frontend/views.py:183 frontend/views.py:185 frontend/views.py:188
#: frontend/views.py:240 frontend/views.py:243
#: frontend/views.py:190 frontend/views.py:193 frontend/views.py:198
#: frontend/views.py:248 frontend/views.py:253
msgid "error_create_view"
msgstr "Ocurrió un error al intentar agregar la cuenta"
#: frontend/views.py:183
#: frontend/views.py:190
msgid "existing_service"
msgstr "Ya existe un servicio llamado %s"
#: frontend/views.py:235
#: frontend/views.py:243
msgid "existing_account_added"
msgstr "La cuenta existente %s fue agregada"
#: frontend/views.py:238
#: frontend/views.py:246
msgid "user_already_has_account"
msgstr "La cuenta %s ya ha sido vinculada"
#: frontend/views.py:286
#: frontend/views.py:294 logica_cuentas/services.py:117
msgid "cuenta_borrada"
msgstr "La cuenta %s ha sido borrada"
#: frontend/views.py:290
#: frontend/views.py:298 logica_cuentas/services.py:121
msgid "cuenta_desvinculada"
msgstr "La cuenta %s ha sido desvinculada"
#: frontend/views.py:293
#: frontend/views.py:301
msgid "error_borrar_cuenta"
msgstr "Ocurrió un error al intentar borrar la cuenta"
#: frontend/views.py:305
#: frontend/views.py:313
msgid "ether_solicitado"
msgstr ""
"Su solicitud de carga para la cuenta %s será evaluada por los "
"administradores. Nos contactaremos a la brevedad."
#: frontend/views.py:308
#: frontend/views.py:316
msgid "error_peticion_ether"
msgstr "No se pudo realizar la petición"
#: frontend/views.py:403
#: frontend/views.py:427
msgid "email_changed"
msgstr ""
"Al cambiar tu dirección de E-mail debes activar nuevamente tu cuenta. "
"Verificá el link que hemos enviado a tu correo"
#: frontend/views.py:429
msgid "user_updated"
msgstr "Usuario modificado"
#: frontend/views.py:405
#: frontend/views.py:433
msgid "user_update_error"
msgstr "Ocurrió un error al intentar modificar el usuario"
#: frontend/views.py:420
#: frontend/views.py:460
msgid "email_changed_subject"
msgstr "E-mail modificado"
#: frontend/views.py:476
msgid "password_changed"
msgstr "Contraseña modificada. Por favor ingresá nuevamente"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment