Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rota2-001 #19

Open
wants to merge 140 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
3b22292
feature:Trying out the keys
Icaro212 Nov 20, 2022
c010cac
feat!: discord bot creation
JStockwell Nov 22, 2022
052e462
feat:Prueba key ssh
Pablosancval Nov 22, 2022
7caea15
feat:Prueba key ssh exitosa
Pablosancval Nov 22, 2022
45f72ae
feature:Working React on the decide aplication
Icaro212 Nov 23, 2022
17692c9
feat: test voting
JStockwell Nov 23, 2022
895e26a
fix: local_settings.example.py
JStockwell Nov 23, 2022
c9f35aa
feat: list-votings get-votings reactivo
JStockwell Nov 23, 2022
8f6ffa8
fix: correctiones miscelaneas
JStockwell Nov 24, 2022
dc29694
feat:Añadidos dos primeros componentes de react y archivo css para la…
javiervaz01 Nov 24, 2022
d0c7e19
feature: first version of navegation bar
Icaro212 Nov 24, 2022
6cdb0aa
feat: Añadido un botón simple de react a la vista de la cabina de vot…
Pablosancval Nov 24, 2022
97f7c36
Merge branch 'Rota2-018' of github.com:Decide-Part-Rota/decide-part-r…
Pablosancval Nov 24, 2022
d535f19
Revert "Merge branch 'Rota2-018' of github.com:Decide-Part-Rota/decid…
Pablosancval Nov 24, 2022
c2ee5f7
Merge remote-tracking branch 'origin/master' into Rota2-004
JStockwell Nov 29, 2022
658960a
Merge remote-tracking branch 'origin/develop' into Rota2-004
JStockwell Nov 29, 2022
3ecce41
fix: calling inactive votings
JStockwell Dec 1, 2022
e33945a
Arreglo de rama Rota2-019
alegestor Dec 1, 2022
8640304
Merge remote-tracking branch 'origin/develop' into Rota2-019
alegestor Dec 4, 2022
bd0a375
feat: bot_test created
JStockwell Dec 7, 2022
e2a7133
fix: removed bot_test.py
JStockwell Dec 9, 2022
aea4e3c
feat: git-fame añadido a requirements
JStockwell Dec 9, 2022
e77e0dd
Merge pull request #22 from Decide-Part-Rota/develop
Icaro212 Dec 9, 2022
891fea8
Merge remote-tracking branch 'origin/develop' into Rota2-019
alegestor Dec 9, 2022
5dfecfe
feature: Añadido los nuevos listados y modifcaciones a las barra de n…
Icaro212 Dec 10, 2022
ff85aa2
feature: Mergando cambios de develop a la rama para continuar trabajando
Icaro212 Dec 10, 2022
875e2c9
Feature: Arreglado componente para el título de la votación y estilos…
javiervaz01 Dec 11, 2022
06c1be2
Merge remote-tracking branch 'origin/Rota2-001' into Rota2-019
alegestor Dec 11, 2022
1ff9850
feat: css y js aplicados a login
alegestor Dec 11, 2022
6111cac
feat: Merge from Rota1-032 from necesary functionalities
Icaro212 Dec 11, 2022
c804a8d
Revert "feat: Merge from Rota1-032 from necesary functionalities"
Icaro212 Dec 11, 2022
ba61ba3
fix: Local_sttings not importing fixed
Icaro212 Dec 11, 2022
e0f299b
Merge remote-tracking branch 'origin/Rota2-019' into Rota2-001
Icaro212 Dec 11, 2022
a1f4fed
fix: margen de las tablas de login
alegestor Dec 11, 2022
65df110
Merge remote-tracking branch 'origin/Rota2-019' into Rota2-001
Icaro212 Dec 11, 2022
9c93c53
fix: Fixing a previous merge
Icaro212 Dec 11, 2022
a866a84
feature: pequeño avance hacia funcionalidad de mejorar cabina de vota…
javiervaz01 Dec 12, 2022
9e9aae7
feature: Added log responsive navbar to the booth
Icaro212 Dec 12, 2022
703f6bf
feat: Merge Rota1-032 to develop the functionality
Icaro212 Dec 12, 2022
15553de
fix: Fixed the merge from Rota1-032 manually
Icaro212 Dec 12, 2022
d728b0c
feat: css y js aplicados al registro
alegestor Dec 12, 2022
4f6c734
Merge remote-tracking branch 'origin/Rota2-001' into Rota2-019
alegestor Dec 12, 2022
b719b11
Feat: welcome css y js
alegestor Dec 12, 2022
64ac462
fix: arreglo de html basico
alegestor Dec 12, 2022
aeac420
feat: tests de login en selenium
alegestor Dec 13, 2022
bb1872f
feat: Views Census addtion and User Voting
Icaro212 Dec 13, 2022
67997b4
fix: añadida dependencia de selenium a requirements.txt
alegestor Dec 13, 2022
7152029
fix: selenium en requirements.txt
alegestor Dec 13, 2022
1ec4a1d
feat: test registro en selenium
alegestor Dec 13, 2022
ce1e9bf
Feat: adesión de selenium a requirements.txt
alegestor Dec 13, 2022
06bc194
fix: Minor codacy fixes
Icaro212 Dec 13, 2022
6e94214
fix: Minor codacy fixes
Icaro212 Dec 13, 2022
686f2c2
fix: Minor codacy fixes again
Icaro212 Dec 13, 2022
62babf3
fix: Minor codacy fixes again
Icaro212 Dec 14, 2022
7549712
fix: Minor codacy fixes again
Icaro212 Dec 14, 2022
66380eb
Merge pull request #27 from Decide-Part-Rota/Rota2-021
Icaro212 Dec 14, 2022
41d4745
Merge remote-tracking branch 'origin/develop' into Rota2-019
alegestor Dec 14, 2022
9cd8e58
Merge pull request #25 from Decide-Part-Rota/Rota2-001
alegestor Dec 14, 2022
d021cdb
Feat: jss form implementado a login
alegestor Dec 14, 2022
5350580
Merge remote-tracking branch 'origin/develop' into Rota2-019
alegestor Dec 14, 2022
55f599c
Fix: codacy errors
alegestor Dec 14, 2022
d8f9ce2
Merge remote-tracking branch 'origin/develop' into Rota2-004
JStockwell Dec 14, 2022
ad4de3b
Fix: Codacy issues
alegestor Dec 14, 2022
a6bd3d6
Fix: codacy errors (again)
alegestor Dec 14, 2022
4547b2a
Merge pull request #28 from Decide-Part-Rota/Rota2-019
Icaro212 Dec 14, 2022
d436065
Merge remote-tracking branch 'origin/develop' into Rota2-020
alegestor Dec 14, 2022
fd51f52
Fix: codacy issues
alegestor Dec 14, 2022
00601b5
Fix: codacy issues (again)
alegestor Dec 14, 2022
591b46a
fix: codacy (again x2)
alegestor Dec 14, 2022
2404a5f
Changes on how to take voting data to work with it in react, almost w…
javiervaz01 Dec 15, 2022
27aed4a
Merge pull request #30 from Decide-Part-Rota/Rota2-020
Icaro212 Dec 15, 2022
3e53566
Data finally taken from back to react, now just style needed
javiervaz01 Dec 15, 2022
025e3f0
Merge remote-tracking branch 'origin/develop' into Rota2-004
JStockwell Dec 16, 2022
ab54d3a
fix: requirements.txt
JStockwell Dec 16, 2022
ad83ad0
Merge branch 'develop' of github.com:Decide-Part-Rota/decide-part-rot…
JStockwell Dec 16, 2022
3ffe7b0
fix: forms regex login format
JStockwell Dec 16, 2022
59999b2
feat: public filter
JStockwell Dec 16, 2022
4bbd413
fix: voting start create_pubkey
JStockwell Dec 16, 2022
951d4d5
fix: Traducción a ingles de autenticación y sus test
alegestor Dec 16, 2022
6042840
fix: codacy issues
alegestor Dec 16, 2022
8bc042f
test: Rota2-001 tests completed + Additional testing for auth
Icaro212 Dec 16, 2022
8382fd6
Merge pull request #32 from Decide-Part-Rota/Rota2-019
Icaro212 Dec 16, 2022
ac8ca6f
feat: initial post voting/person rest api
JStockwell Dec 17, 2022
05bfe4e
fix: function complexity refactor
JStockwell Dec 17, 2022
9cbb1c6
feat: vote posting message
JStockwell Dec 17, 2022
f24abdb
fix: Online testing working again
Icaro212 Dec 17, 2022
6d2cdad
fix: Codacy errors corrected
Icaro212 Dec 17, 2022
dda1030
feat: untested elgamal encryption
JStockwell Dec 17, 2022
7b486a8
fix: test bigpk removed
JStockwell Dec 17, 2022
8fd7c9b
test: test negativo contraseña limitar
Pablosancval Dec 17, 2022
60c2f82
test: test negativo contraseña muy corta
Pablosancval Dec 17, 2022
f8c34b9
test: test negativo contraseña comun
Pablosancval Dec 17, 2022
b30c703
test: test negativo contraseña numérica
Pablosancval Dec 17, 2022
c43b3e6
test: test negativo mail sin @
Pablosancval Dec 17, 2022
40174b8
test: test negativo usuario vacío
Pablosancval Dec 17, 2022
e476b6e
fix: headless estaba en false
Pablosancval Dec 17, 2022
84ab956
fix: Codacy errors
Icaro212 Dec 17, 2022
36d756d
Merge remote-tracking branch 'origin/Rota2-004' into Rota2-024
JStockwell Dec 17, 2022
0d5cba7
"feat: test suite registro
JStockwell Dec 17, 2022
83d1bc2
fix: removed data print
Pablosancval Dec 17, 2022
cb5eb5f
All css and style almost finished
javiervaz01 Dec 18, 2022
b3409b0
feat: All css and react finished
javiervaz01 Dec 18, 2022
1c7b724
2 first tests in selenium done, 4 remaining
javiervaz01 Dec 18, 2022
ca7e66f
!feat: Rota2-004 completado
JStockwell Dec 18, 2022
d6c000e
fix: removed obsolete test_registro
JStockwell Dec 18, 2022
1e18398
fix: removed obsolete test.py selenium
JStockwell Dec 18, 2022
0cf54fb
Merge branch 'develop' into Rota2-004
JStockwell Dec 18, 2022
1e702b4
fix: bot.py codacy
JStockwell Dec 18, 2022
8af899b
fix: more codacy
JStockwell Dec 18, 2022
0744378
Tests finished
javiervaz01 Dec 18, 2022
bc80a6f
fix: misc fixes
Pablosancval Dec 18, 2022
08af607
fix: bot.py formatting
JStockwell Dec 18, 2022
edb914a
fix: more codacy
Pablosancval Dec 18, 2022
239e5f8
fix: whitespace
Pablosancval Dec 18, 2022
93836ab
Merge pull request #37 from Decide-Part-Rota/Rota2-004
Pablosancval Dec 18, 2022
61ed4e8
Merge remote-tracking branch 'origin/develop' into Rota2-024
Pablosancval Dec 18, 2022
c4ae5a2
fix: translation test
Pablosancval Dec 18, 2022
2158792
Merge branch 'develop' into Rota2-022
alegestor Dec 18, 2022
d636f41
Update test_selenium_login.py
alegestor Dec 18, 2022
eca8585
Merge pull request #35 from Decide-Part-Rota/Rota2-023
alegestor Dec 18, 2022
53374ea
Merge pull request #33 from Decide-Part-Rota/Rota2-022
alegestor Dec 18, 2022
f9817b6
Merge remote-tracking branch 'origin/develop' into Rota2-024
alegestor Dec 18, 2022
d773e22
Tests fixed
javiervaz01 Dec 18, 2022
aa00a23
Merge pull request #38 from Decide-Part-Rota/Rota2-024
alegestor Dec 18, 2022
f1e7740
Merge branch 'develop' into Rota2-018
javiervaz01 Dec 18, 2022
bd0a220
Añadida etiqueta de skip a los tests de boothç
javiervaz01 Dec 18, 2022
979bfba
Añadida etiqueta de skip a los tests de booth
javiervaz01 Dec 18, 2022
636458e
Codacy problems fixed
javiervaz01 Dec 18, 2022
d50508b
minor codacy fix
javiervaz01 Dec 18, 2022
9057165
fix: fallos en codacy en style.css
javiervaz01 Dec 18, 2022
ee73ec3
fix: mas fallos en codacy en style.css
javiervaz01 Dec 18, 2022
e8cb8f4
Merge pull request #39 from Decide-Part-Rota/Rota2-018
Icaro212 Dec 18, 2022
5cfdeba
Revert "Rota2 018"
Icaro212 Dec 18, 2022
42da9ee
Merge pull request #40 from Decide-Part-Rota/revert-39-Rota2-018
Icaro212 Dec 18, 2022
61919d3
Merge pull request #41 from Decide-Part-Rota/develop
javiervaz01 Dec 18, 2022
e7f8e98
Feat: Toda la implementación de react y estilos de css añadidos debid…
javiervaz01 Dec 18, 2022
763a367
Fix: Print molesto eliminado de views.py
javiervaz01 Dec 18, 2022
37a2d32
fix: Minor codacy fixes
Icaro212 Dec 18, 2022
de272f2
Merge pull request #42 from Decide-Part-Rota/Rota2-018
Icaro212 Dec 18, 2022
44f4df7
Merge pull request #43 from Decide-Part-Rota/develop
JStockwell Dec 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .CommitsTemplate.txt

This file was deleted.

2 changes: 0 additions & 2 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ jobs:
build:

runs-on: ubuntu-latest

env:
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_SECRET: ${{ secrets.GOOGLE_SECRET }}
EMAIL_USER: ${{ secrets.EMAIL_USER }}
EMAIL_PASSWORD: ${{ secrets.EMAIL_PASSWORD }}


services:
postgres:
image: postgres:10.8
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ coverage.xml
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Plataforma voto electrónico educativa
=====================================

Funciona
El objetivo de este proyecto es implementar una plataforma de voto
electrónico seguro, que cumpla una serie de garantías básicas, como la
anonimicidad y el secreto del voto.
Expand Down Expand Up @@ -289,5 +289,4 @@ A tener en cuenta:
* En un servidor local, con un postgres que por defecto nos viene limitado a 100 usuarios
concurrentes, cuando pongamos más de 100, lo normal es que empiecen a fallar muchas peticiones.
* Si hacemos las pruebas en local, donde tenemos activado el modo debug de Django, lo normal es que
las peticiones tarden algo más y consigamos menos RPS (Peticiones por segundo)

las peticiones tarden algo más y consigamos menos RPS (Peticiones por segundo)..
32 changes: 24 additions & 8 deletions decide/authentication/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,45 @@
from django.forms import ModelForm
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.core.validators import RegexValidator
from .models import Person
from django.contrib.auth.forms import UserCreationForm
from django_countries.fields import CountryField

sexos=[("mujer","Mujer"),("hombre","Hombre"),("otro","Otro")]
status=[("soltero","Soltero"),("conviviente","Conviviente"),("casado","Casado"),("divorciado","Divorciado"),("viudo","Viudo")]


sex=[("woman","Woman"),("man","Man"),("other","Other")]
status=[("single","Single"),("partner","Partner"),("married","Married"),("divorced","Divorced"),("widow","Widow")]
discord_validator = RegexValidator('.+#\d{4}')

class PersonForm(UserCreationForm):
sex = forms.ChoiceField(choices=sexos, required=True, label="Seleccione su sexo")
sex = forms.ChoiceField(choices=sex, required=True, label="Select your gender")
age = forms.IntegerField(required=False)
status = forms.ChoiceField(choices=status, required=True, label="Seleccione su estado civil")
discord_account = forms.CharField(required=False, help_text="Please use the following format: name#XXXX", validators=[discord_validator], max_length=30)
country = CountryField().formfield()

def clean_age(self):
data = self.cleaned_data["age"]

if not data:
self.add_error("age", "Debes especificar una edad")

if data == 0:
self.add_error("age", "Introduce una edad valida")
return data



class Meta:
model=User
fields=["username","password1","password2","email","sex","age","status","country"]
fields=["username","password1","password2","email","sex","age","status","country","discord_account"]


class CompleteForm(forms.Form):
sex = forms.ChoiceField(choices=sexos, required=True)
sex = forms.ChoiceField(choices=sex, required=True)
age = forms.IntegerField(required=True)
status = forms.ChoiceField(choices=status, required=True, label="Seleccione su estado civil")
status = forms.ChoiceField(choices=status, required=True, label="Select your civil status")
country = CountryField().formfield()
discord_account = forms.CharField(required=False, help_text="Please use the following format: name#XXXX", validators=[discord_validator], max_length=30)



Expand Down
18 changes: 18 additions & 0 deletions decide/authentication/migrations/0007_person_discord_account.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.0 on 2022-12-14 22:06

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('authentication', '0006_auto_20221202_0115'),
]

operations = [
migrations.AddField(
model_name='person',
name='discord_account',
field=models.CharField(blank=True, max_length=30),
),
]
2 changes: 2 additions & 0 deletions decide/authentication/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class Person(models.Model):
sex = models.CharField(max_length=30, blank=False)
age = models.PositiveIntegerField()
status = models.CharField(max_length=30, blank=False)
discord_account = models.CharField(max_length=30, blank=True)

country=CountryField()

def __str__(self):
Expand Down
7 changes: 7 additions & 0 deletions decide/authentication/serializers.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
from rest_framework import serializers

from django.contrib.auth.models import User
from .models import Person


class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('id', 'username', 'first_name', 'last_name', 'email', 'is_staff')

class PersonSerializer(serializers.HyperlinkedModelSerializer):
user = UserSerializer()
class Meta:
model = Person
fields = ('id', 'user', 'sex', 'age', 'status', 'discord_account', 'country')
33 changes: 33 additions & 0 deletions decide/authentication/static/reactComponents/loginForm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"use strict";

const createLoginForm = React.createElement;

class LoginForm extends React.Component {
render() {
return createLoginForm(
"body",
{},
createLoginForm("table",
{className:"table"},
createLoginForm(
"tr",{},
createLoginForm("th",{scope:"row"},"Username / Email"),
createLoginForm(
"td",{},
createLoginForm("input",{type:"text",name:"username"}),
)
),
createLoginForm("tr",{},
createLoginForm("th",{scope:"row"},"Password"),
createLoginForm("td",{},
createLoginForm("input",{type:"password",name:"password"}),
),
),
),
);}

}

const domContainerLoginForm = document.querySelector("#loginForm");
const rootLoginForm = ReactDOM.createRoot(domContainerLoginForm);
rootLoginForm.render(createLoginForm(LoginForm));
17 changes: 17 additions & 0 deletions decide/authentication/static/reactComponents/loginTitle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"use strict";

const create = React.createElement;

class Title extends React.Component {
render() {
return create(
"body",{},
create("h2",{className:"Title"},"Login"),
);
}

}

const domContainer = document.querySelector("#title");
const root = ReactDOM.createRoot(domContainer);
root.render(create(Title));
13 changes: 13 additions & 0 deletions decide/authentication/static/reactComponents/registerTitle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"use strict";

const create = React.createElement;

class Title extends React.Component {
render() {
return create("body",{}, create("h2",{className:"Title"},"Sign Up"));}

}

const domContainer = document.querySelector("#title");
const root = ReactDOM.createRoot(domContainer);
root.render(create(Title));
35 changes: 35 additions & 0 deletions decide/authentication/static/reactComponents/welcome.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"use strict";

const createWelcome = React.createElement;

class Welcome extends React.Component {
render() {
return createWelcome(
"body",
{},
createWelcome(
"div",{className:"welcome"},
createWelcome("br"),
createWelcome(
"h2",{className:"h2Welcome"},"Welcome!"),
createWelcome(
"p",
{className:"pWelcome"},
"To enter admin mode, just click the button!"),
createWelcome(
"div",{className:"divWelcomeButton"},
createWelcome(
"a",{className:"aWelcome", href: "/admin/"},
createWelcome(
"button", {className:"buttonWelcome"} ,"Admin"),
)
),
createWelcome("br")
)
);}

}

const domContainerWelcome = document.querySelector("#welcome");
const rootWelcome = ReactDOM.createRoot(domContainerWelcome);
rootWelcome.render(createWelcome(Welcome));
31 changes: 31 additions & 0 deletions decide/authentication/static/registration/login.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.prueba {
flex-direction: column;
justify-content: center;
align-items: center;
margin: auto;
height: auto;
width: 22vw;
background-color: white;
border-radius: 10px;
text-align: justify;
}

.buttons {
text-align: center;
}

header {
display: flex;
justify-content: flex-end;
align-items: center;
padding: 30px 10%;
background-color: #0b0c10;
}

.bar{
color: #edf0f1;
}

.Title{
text-align: center;
}
36 changes: 36 additions & 0 deletions decide/authentication/static/registration/register.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.bar {
color: #edf0f1;
}

header {
display: flex;
align-items: center;
padding: 30px 10%;
background-color: #0b0c10;
justify-content: flex-end;
}

.registerForm {
flex-direction: column;
justify-content: center;
align-items: center;
margin: auto;
height: auto;
width: 47vw;
text-align: justify;
background-color: white;
border-radius: 10px;
}

.Title {
background-color: white;
text-align: center;
}

.buttons {
text-align: center;
}

td, th {
vertical-align: top;
}
24 changes: 24 additions & 0 deletions decide/authentication/static/registration/welcome.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.h2Welcome {
text-align: center;
}

.welcome {
flex-direction: column;
justify-content: center;
align-items: center;
height: auto;
width: 20vw;
border-radius: 10px;
text-align: center;
background-color: white;
margin: auto;
}

.pWelcome, .h2Welcome {
color: black;
}

.pWelcome {
text-align: justify;
margin-left: 25px;
}
1 change: 1 addition & 0 deletions decide/authentication/templates/anonymous.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Welcome Anonymous
Loading