forked from PyAr/asoc_members
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix PyAr#50 custom thankyou page and send application letter
Signed-off-by: Matias Varela <[email protected]>
- Loading branch information
Showing
13 changed files
with
392 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,3 +110,4 @@ scripts/*.csv | |
scripts/credentials.json | ||
.idea | ||
.vscode | ||
/media/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
website/members/migrations/0021_member_application_letter.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 2.0.4 on 2019-03-05 03:41 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('members', '0020_auto_20190209_1148'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='member', | ||
name='application_letter', | ||
field=models.FileField(blank=True, null=True, upload_to='application_letter', verbose_name='carta de afiliación'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Generated by Django 2.0.4 on 2019-06-02 19:55 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('members', '0021_member_application_letter'), | ||
('members', '0023_auto_20190407_1624'), | ||
] | ||
|
||
operations = [ | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
119 changes: 119 additions & 0 deletions
119
website/members/templates/members/signup_person_thankyou.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
{% extends "members/signup_initial.html" %} | ||
{% load crispy_forms_tags %} | ||
{% block inner-content %} | ||
<div class="categories"> | ||
<h4 class="alert alert-success"> Su solicitud fue enviada con éxito</h4> | ||
<h3>Próximos pasos</h3> | ||
{% if missing_signed_letter %} | ||
<p> | ||
Tenés que mandar una carta en papel, firmada, expresando tu intención de querer asociarte (es un paso | ||
necesario desde el punto de vista legal). | ||
|
||
Nosotros te la generamos automáticamente (<a target="_blank" href="{{ object.application_letter.url }}">descargar</a>), | ||
revisá los datos, imprimila y a mano poné lugar y fecha, firmá, aclará y poné tu DNI. | ||
</p> | ||
<p> | ||
Para acelerar el trámite, sacale una foto y mandánosla, pero también la vas a tener que mandar por correo postal | ||
o llevarla en mano a la sede de la Asociación Civil <strong>**</strong> (o traerla a algún evento de PyAr y | ||
dársela a cualquiera de la Comisión Directiva). | ||
</p> | ||
{% endif %} | ||
|
||
{% if missing_student_certif %} | ||
<p> | ||
Como sos socia/o "Estudiante", necesitamos un Certificado de Alumna/o Regular. | ||
|
||
Cuando lo consigas, para acelerar el trámite, sacale una foto y mandánosla, pero también la | ||
vas a tener que mandar por correo postal o llevarla en mano a la sede de la Asociación Civil <strong>**</strong> (o | ||
traerla a algún evento de PyAr y dársela a cualquiera de la Comisión Directiva). | ||
</p> | ||
{% endif %} | ||
|
||
{% if missing_payment %} | ||
<p> | ||
Tenés que pagar la cuota social. En tu caso, para Socia/o tipo {{ object.category }}, | ||
son ${{ object.category.fee }} por mes, y lo podés abonar de distintas maneras:</p> | ||
<p> | ||
Débito mensual, usando una tarjeta de crédito: | ||
{% if object.category == object.category.ACTIVE %} | ||
<a href="http://mpago.la/1WDPgB">http://mpago.la/1WDPgB</a> | ||
{% elif object.category == object.category.SUPPORTER %} | ||
<a href="http://mpago.la/3c4foF">http://mpago.la/3c4foF</a> | ||
{% else %} | ||
{{ on_purpose_missing_var }} | ||
{% endif %} | ||
</p> | ||
{% endif %} | ||
|
||
<p> | ||
También podés pagar el año entero (un total de ${{ annual_fee }}) directamente por transferencia o depósito a... | ||
<br> | ||
<blockquote> | ||
Asociación Civil Python Argentina<br> | ||
Banco Credicoop<br> | ||
Cuenta Corriente en pesos<br> | ||
Nro. 191-153-009748/3<br> | ||
CBU 19101530-55015300974832<br> | ||
Alias python | ||
</blockquote> | ||
|
||
... o con tarjetas de crédito, débito, pagofácil, rapipago, etc: | ||
|
||
{% if object.category == object.category.ACTIVE %} | ||
<a href="https://forms.todopago.com.ar/formulario/commands?command=formulario&fr=1&m=4dee293be8f02f0a40d94e9d580c306b">Pagar con TodoPago</a> | ||
|
||
{% elif object.category == object.category.SUPPORTER %} | ||
<a href="https://forms.todopago.com.ar/formulario/commands?command=formulario&fr=1&m=7bc16ade2a98bf5953aca03084d433b6">Pagar con Todo</a> | ||
|
||
{% else %} | ||
{{ on_purpose_missing_var }} | ||
{% endif %} | ||
</p> | ||
{% if missing_nickname %} | ||
<p> | ||
Pasanos un nick o sobrenombre, para el carnet de asociada/o, totalmente opcional (pero si no | ||
querés avisanos así dejamos de pedirte). | ||
</p> | ||
{% endif %} | ||
|
||
{% if missing_picture %} | ||
<p> | ||
Pasanos una foto cuadrada o cualquier imagen cuadrada, para el carnet de asociada/o, totalmente opcional | ||
(pero si no querés avisanos así dejamos de pedirte). | ||
</p> | ||
{% endif %} | ||
|
||
{% if missing_collab_accept %} | ||
<p> | ||
Como sos socia/o "Colaborador/a", tenés que anotarte para colaborar.<br> | ||
|
||
La dinámica es la siguiente: tenemos un grupo de Telegram donde distintos responsables de la | ||
Asociación Civil podemos pedir cosas y vos u otro/a socio/a lo pueden agarrar para hacer. Ejemplo de | ||
un pedido posible: "hay que arreglar un bug en el sistema de gestión de la Asoc Civil (hecho en Django) | ||
que no muestra tal cosa en tal lugar".<br> | ||
|
||
Obvio, cada uno agarrará lo que pueda resolver, pero la idea es que colaboren Participar en ese canal y | ||
realmente colaborar con lo que la Asociación Civil necesite es condición necesaria para que al año se | ||
renueve la posibilidad de ser socio/a Colaborador/a.<br> | ||
|
||
Entonces, pasame por favor tu handle de Telegram así te invito al grupo. | ||
</p> | ||
{% endif %} | ||
|
||
|
||
{% if missing_signed_letter or missing_student_certif %} | ||
<p> | ||
<strong>**</strong> La dirección de la sede: | ||
<blockquote> | ||
Asociación Civil Python Argentina<br> | ||
Chile 1155, piso 1<br> | ||
CABA (C1098AAW)<br> | ||
Buenos Aires, Argentina<br> | ||
</blockquote> | ||
</p> | ||
{% endif %} | ||
<p> | ||
<a class="btn btn-primary" href="https://ac.python.org.ar">Ir a la página de la asociación</a> | ||
</p> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
from django.utils.timezone import now, make_aware | ||
from django.urls import reverse | ||
|
||
from members import logic, views | ||
from members import logic, utils | ||
from members.models import ( | ||
Member, Patron, Category, PaymentStrategy, Quota, Person, | ||
Organization) | ||
|
@@ -99,13 +99,14 @@ def test_signup_submit_success(self): | |
response = self.client.get(reverse('signup_person')) | ||
response = self.client.post(reverse('signup_person'), data=data) | ||
self.assertEqual(response.status_code, 302) | ||
self.assertEqual(response.url, reverse('signup_thankyou')) | ||
person = Person.objects.get(nickname='pepepin') | ||
self.assertEqual(response.url, reverse('signup_person_thankyou', args=[person.membership_id])) | ||
self.assertEqual(person.first_name, 'Pepe') | ||
self.assertEqual(person.email, '[email protected]') | ||
self.assertEqual(person.birth_date, datetime.date(1999, 12, 11)) | ||
self.assertEqual(person.membership.category.pk, cat.pk) | ||
self.assertEqual(person.membership.patron.email, person.email) | ||
self.assertIsNotNone(person.membership.application_letter) | ||
|
||
def test_signup_submit_success_without_optionals(self): | ||
# crear categoria | ||
|
@@ -130,8 +131,8 @@ def test_signup_submit_success_without_optionals(self): | |
response = self.client.get(reverse('signup_person')) | ||
response = self.client.post(reverse('signup_person'), data=data) | ||
self.assertEqual(response.status_code, 302) | ||
self.assertEqual(response.url, reverse('signup_thankyou')) | ||
person = Person.objects.get(document_number='124354656') | ||
self.assertEqual(response.url, reverse('signup_person_thankyou', args=[person.membership_id])) | ||
self.assertEqual(person.first_name, 'Pepe') | ||
self.assertEqual(person.email, '[email protected]') | ||
self.assertEqual(person.birth_date, datetime.date(1999, 12, 11)) | ||
|
@@ -175,7 +176,7 @@ def test_signup_org_submit_success(self): | |
response = self.client.get(reverse('signup_organization')) | ||
response = self.client.post(reverse('signup_organization'), data=data) | ||
self.assertEqual(response.status_code, 302) | ||
self.assertEqual(response.url, reverse('signup_thankyou')) | ||
self.assertEqual(response.url, reverse('signup_organization_thankyou')) | ||
orga = Organization.objects.get(name='Orga') | ||
self.assertEqual(orga.contact_info, random_text) | ||
|
||
|
@@ -576,21 +577,21 @@ class BuildDebtStringTestCase(TestCase): | |
"""Tests for the string debt building utility.""" | ||
|
||
def test_empty(self): | ||
result = views._build_debt_string([]) | ||
result = utils.build_debt_string([]) | ||
self.assertEqual(result, "-") | ||
|
||
def test_1(self): | ||
result = views._build_debt_string([(2018, 8)]) | ||
result = utils.build_debt_string([(2018, 8)]) | ||
self.assertEqual(result, "1 (2018-08)") | ||
|
||
def test_2(self): | ||
result = views._build_debt_string([(2018, 8), (2018, 9)]) | ||
result = utils.build_debt_string([(2018, 8), (2018, 9)]) | ||
self.assertEqual(result, "2 (2018-08, 2018-09)") | ||
|
||
def test_3(self): | ||
result = views._build_debt_string([(2018, 8), (2018, 9), (2018, 10)]) | ||
result = utils.build_debt_string([(2018, 8), (2018, 9), (2018, 10)]) | ||
self.assertEqual(result, "3 (2018-08, 2018-09, 2018-10)") | ||
|
||
def test_exceeding(self): | ||
result = views._build_debt_string([(2018, 8), (2018, 9), (2018, 10), (2018, 11)]) | ||
result = utils.build_debt_string([(2018, 8), (2018, 9), (2018, 10), (2018, 11)]) | ||
self.assertEqual(result, "4 (2018-08, 2018-09, 2018-10, ...)") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.