Compare commits
99 commits
luj/adhesi
...
master
Author | SHA1 | Date | |
---|---|---|---|
2126224e15 | |||
d6109a9312 | |||
a69bd0426f | |||
81a4dbef7c | |||
4fedf3453d | |||
8607d77c84 | |||
bc55a3067e | |||
dd68ad91cd | |||
2f71246509 | |||
a20a1c11d6 | |||
0e1ff1765a | |||
177d413f4c | |||
01dd16c795 | |||
84c87c1b4b | |||
1b143b322f | |||
f9456e3c29 | |||
dd1350f1c2 | |||
8f4cb68d31 | |||
3a3f96a8df | |||
7d8926e459 | |||
3fee014384 | |||
cd351786bb | |||
7362c2fa2a | |||
efbc947145 | |||
0c45262fbc | |||
cabd277b4a | |||
4108efe8c9 | |||
693e4252d5 | |||
3aa928e8f0 | |||
5e2e68960b | |||
91e9beee11 | |||
ac286209ed | |||
b03cda5962 | |||
4feb567af7 | |||
1ac47885d0 | |||
071c810605 | |||
7f00ce0ff1 | |||
95136cb4eb | |||
e299997aa8 | |||
40f34926bb | |||
69976a878a | |||
6621ae3950 | |||
9288daaf9e | |||
e92c500940 | |||
|
d75eaf583f | ||
55bd3ab51d | |||
|
f640a25f59 | ||
|
f881c7cd8b | ||
b548b87c25 | |||
|
a72302291f | ||
a0bde75f50 | |||
|
44b19c12e5 | ||
f97d339a1c | |||
|
094116e88d | ||
b32a07fc22 | |||
|
4fc9902cf6 | ||
7164cfa37a | |||
|
90f96fb5c9 | ||
e50249355d | |||
|
c304d734d9 | ||
c36dd30bce | |||
2571cc955e | |||
3eaac5c68f | |||
af4c8e0744 | |||
14e0a3ef0a | |||
|
83078d4726 | ||
cb262ad479 | |||
5c47118834 | |||
30e842ce80 | |||
892bf51163 | |||
e20d7ca6c2 | |||
|
1b09293206 | ||
|
e7da476697 | ||
|
761ab6df90 | ||
|
a8d4035d33 | ||
b80426c56f | |||
429e611daa | |||
|
5160da7862 | ||
aad3775222 | |||
4b92716092 | |||
dfa5b4bf69 | |||
|
1be5dcb6af | ||
a891ec56a6 | |||
7a52690a63 | |||
a2f396ce7a | |||
85e30056a6 | |||
|
69de48f285 | ||
|
eba36f2712 | ||
|
bfdb34aae7 | ||
fcf2002cd7 | |||
b236d6a950 | |||
4b29097f02 | |||
87f383bef1 | |||
|
1ad025e046 | ||
|
b3c047738a | ||
|
17a9ae3302 | ||
|
e41bcbb6d7 | ||
|
e384bfb0f3 | ||
373ff1f62c |
262 changed files with 1997 additions and 646 deletions
1
.envrc
Normal file
1
.envrc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
use nix
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -5,6 +5,7 @@ cof/settings.py
|
||||||
settings.py
|
settings.py
|
||||||
*~
|
*~
|
||||||
venv/
|
venv/
|
||||||
|
.venv/
|
||||||
.vagrant
|
.vagrant
|
||||||
/src
|
/src
|
||||||
media/
|
media/
|
||||||
|
@ -19,3 +20,4 @@ media/
|
||||||
|
|
||||||
# VSCode
|
# VSCode
|
||||||
.vscode/
|
.vscode/
|
||||||
|
.direnv
|
||||||
|
|
|
@ -43,13 +43,21 @@ variables:
|
||||||
# Keep this disabled for now, as it may kill GitLab...
|
# Keep this disabled for now, as it may kill GitLab...
|
||||||
# coverage: '/TOTAL.*\s(\d+\.\d+)\%$/'
|
# coverage: '/TOTAL.*\s(\d+\.\d+)\%$/'
|
||||||
|
|
||||||
|
kfettest:
|
||||||
|
stage: test
|
||||||
|
extends: .test_template
|
||||||
|
variables:
|
||||||
|
DJANGO_SETTINGS_MODULE: "gestioasso.settings.cof_prod"
|
||||||
|
script:
|
||||||
|
- coverage run manage.py test kfet
|
||||||
|
|
||||||
coftest:
|
coftest:
|
||||||
stage: test
|
stage: test
|
||||||
extends: .test_template
|
extends: .test_template
|
||||||
variables:
|
variables:
|
||||||
DJANGO_SETTINGS_MODULE: "gestioasso.settings.cof_prod"
|
DJANGO_SETTINGS_MODULE: "gestioasso.settings.cof_prod"
|
||||||
script:
|
script:
|
||||||
- coverage run manage.py test gestioncof bda kfet petitscours shared --parallel
|
- coverage run manage.py test gestioncof bda petitscours shared --parallel
|
||||||
|
|
||||||
bdstest:
|
bdstest:
|
||||||
stage: test
|
stage: test
|
||||||
|
|
52
CHANGELOG.md
52
CHANGELOG.md
|
@ -23,8 +23,60 @@ adhérents ni des cotisations.
|
||||||
|
|
||||||
## TODO Prod
|
## TODO Prod
|
||||||
|
|
||||||
|
- Lancer `python manage.py update_translation_fields` après la migration
|
||||||
|
- Mettre à jour les units systemd `daphne.service` et `worker.service`
|
||||||
|
|
||||||
- Créer un compte hCaptcha (https://www.hcaptcha.com/), au COF, et remplacer les secrets associés
|
- Créer un compte hCaptcha (https://www.hcaptcha.com/), au COF, et remplacer les secrets associés
|
||||||
|
|
||||||
|
## Version ??? - ??/??/????
|
||||||
|
|
||||||
|
## Version 0.15.1 - 15/06/2023
|
||||||
|
|
||||||
|
### K-Fêt
|
||||||
|
|
||||||
|
- Rattrape les erreurs d'envoi de mail de négatif
|
||||||
|
- Utilise l'adresse chefs pour les envois de négatifs
|
||||||
|
|
||||||
|
## Version 0.15 - 22/05/2023
|
||||||
|
|
||||||
|
### K-Fêt
|
||||||
|
|
||||||
|
- Rajoute un formulaire de contact
|
||||||
|
- Rajoute un formulaire de demande de soirée
|
||||||
|
- Désactive les mails d'envoi de négatifs sur les comptes gelés
|
||||||
|
|
||||||
|
## Version 0.14 - 19/05/2023
|
||||||
|
|
||||||
|
- Répare les dépendances en spécifiant toutes les versions
|
||||||
|
|
||||||
|
### K-Fêt
|
||||||
|
|
||||||
|
- Répare la gestion des changement d'heure via moment.js
|
||||||
|
|
||||||
|
## Version 0.13 - 19/02/2023
|
||||||
|
|
||||||
|
### K-Fêt
|
||||||
|
|
||||||
|
- Rajoute la valeur des inventaires
|
||||||
|
- Résout les problèmes de négatif ne disparaissant pas
|
||||||
|
- Affiche son surnom s'il y en a un
|
||||||
|
- Bugfixes
|
||||||
|
|
||||||
|
## Version 0.12.1 - 03/10/2022
|
||||||
|
|
||||||
|
### K-Fêt
|
||||||
|
|
||||||
|
- Fixe un problème de rendu causé par l'agrandissement du menu
|
||||||
|
|
||||||
|
- Mise à jour vers Channels 3.x et Django 3.2
|
||||||
|
|
||||||
|
## Version 0.12 - 17/06/2022
|
||||||
|
|
||||||
|
### K-Fêt
|
||||||
|
|
||||||
|
- Ajoute une exception à la limite d'historique pour les comptes `LIQ` et `#13`
|
||||||
|
- Répare le problème des étiquettes LIQ/Comptes K-Fêt inversées dans les stats des articles K-Fêt
|
||||||
|
|
||||||
## Version 0.11 - 26/10/2021
|
## Version 0.11 - 26/10/2021
|
||||||
|
|
||||||
### COF
|
### COF
|
||||||
|
|
|
@ -211,7 +211,6 @@ class AttributionAdminForm(forms.ModelForm):
|
||||||
|
|
||||||
|
|
||||||
class AttributionAdmin(ReadOnlyMixin, admin.ModelAdmin):
|
class AttributionAdmin(ReadOnlyMixin, admin.ModelAdmin):
|
||||||
|
|
||||||
list_display = ("id", "spectacle", "participant", "given", "paid")
|
list_display = ("id", "spectacle", "participant", "given", "paid")
|
||||||
search_fields = (
|
search_fields = (
|
||||||
"spectacle__title",
|
"spectacle__title",
|
||||||
|
|
|
@ -2,7 +2,6 @@ import random
|
||||||
|
|
||||||
|
|
||||||
class Algorithm(object):
|
class Algorithm(object):
|
||||||
|
|
||||||
shows = None
|
shows = None
|
||||||
ranks = None
|
ranks = None
|
||||||
origranks = None
|
origranks = None
|
||||||
|
|
|
@ -81,7 +81,7 @@ class Command(MyBaseCommand):
|
||||||
shows = random.sample(
|
shows = random.sample(
|
||||||
list(tirage.spectacle_set.all()), tirage.spectacle_set.count() // 2
|
list(tirage.spectacle_set.all()), tirage.spectacle_set.count() // 2
|
||||||
)
|
)
|
||||||
for (rank, show) in enumerate(shows):
|
for rank, show in enumerate(shows):
|
||||||
choices.append(
|
choices.append(
|
||||||
ChoixSpectacle(
|
ChoixSpectacle(
|
||||||
participant=part,
|
participant=part,
|
||||||
|
|
|
@ -6,7 +6,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL)]
|
dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL)]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -35,7 +35,6 @@ def fill_tirage_fields(apps, schema_editor):
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("bda", "0001_initial")]
|
dependencies = [("bda", "0001_initial")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("bda", "0002_add_tirage")]
|
dependencies = [("bda", "0002_add_tirage")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("bda", "0003_update_tirage_and_spectacle")]
|
dependencies = [("bda", "0003_update_tirage_and_spectacle")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("bda", "0004_mails-rappel")]
|
dependencies = [("bda", "0004_mails-rappel")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -18,7 +18,6 @@ def forwards_func(apps, schema_editor):
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("bda", "0005_encoding")]
|
dependencies = [("bda", "0005_encoding")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("bda", "0006_add_tirage_switch")]
|
dependencies = [("bda", "0006_add_tirage_switch")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("bda", "0007_extends_spectacle")]
|
dependencies = [("bda", "0007_extends_spectacle")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -6,7 +6,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("bda", "0008_py3")]
|
dependencies = [("bda", "0008_py3")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -21,7 +21,6 @@ def forwards_func(apps, schema_editor):
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("bda", "0009_revente")]
|
dependencies = [("bda", "0009_revente")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("bda", "0010_spectaclerevente_shotgun")]
|
dependencies = [("bda", "0010_spectaclerevente_shotgun")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("bda", "0011_tirage_appear_catalogue")]
|
dependencies = [("bda", "0011_tirage_appear_catalogue")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -13,7 +13,6 @@ def swap_double_choice(apps, schema_editor):
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("bda", "0011_tirage_appear_catalogue")]
|
dependencies = [("bda", "0011_tirage_appear_catalogue")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -6,7 +6,6 @@ from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("bda", "0012_notif_time"), ("bda", "0012_swap_double_choice")]
|
dependencies = [("bda", "0012_notif_time"), ("bda", "0012_swap_double_choice")]
|
||||||
|
|
||||||
operations = []
|
operations = []
|
||||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("bda", "0013_merge_20180524_2123")]
|
dependencies = [("bda", "0013_merge_20180524_2123")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -29,7 +29,6 @@ def set_participant_payment(apps, schema_editor):
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("bda", "0014_attribution_paid_field")]
|
dependencies = [("bda", "0014_attribution_paid_field")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("bda", "0015_move_bda_payment")]
|
dependencies = [("bda", "0015_move_bda_payment")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("bda", "0016_delete_participant_paid")]
|
dependencies = [("bda", "0016_delete_participant_paid")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("bda", "0017_participant_accepte_charte"),
|
("bda", "0017_participant_accepte_charte"),
|
||||||
]
|
]
|
||||||
|
|
23
bda/migrations/0019_auto_20220630_1245.py
Normal file
23
bda/migrations/0019_auto_20220630_1245.py
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# Generated by Django 3.2.13 on 2022-06-30 10:45
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
("bda", "0018_auto_20201021_1818"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterUniqueTogether(
|
||||||
|
name="choixspectacle",
|
||||||
|
unique_together=set(),
|
||||||
|
),
|
||||||
|
migrations.AddConstraint(
|
||||||
|
model_name="choixspectacle",
|
||||||
|
constraint=models.UniqueConstraint(
|
||||||
|
fields=("participant", "spectacle"), name="unique_participation"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
|
@ -253,7 +253,11 @@ class ChoixSpectacle(models.Model):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ("priority",)
|
ordering = ("priority",)
|
||||||
unique_together = (("participant", "spectacle"),)
|
constraints = [
|
||||||
|
models.UniqueConstraint(
|
||||||
|
fields=["participant", "spectacle"], name="unique_participation"
|
||||||
|
)
|
||||||
|
]
|
||||||
verbose_name = "voeu"
|
verbose_name = "voeu"
|
||||||
verbose_name_plural = "voeux"
|
verbose_name_plural = "voeux"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base_title.html" %}
|
{% extends "base_title.html" %}
|
||||||
{% load staticfiles %}
|
{% load static %}
|
||||||
|
|
||||||
{% block extra_head %}
|
{% block extra_head %}
|
||||||
<link type="text/css" rel="stylesheet" href="{% static "bda/css/bda.css" %}" />
|
<link type="text/css" rel="stylesheet" href="{% static "bda/css/bda.css" %}" />
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base_title.html" %}
|
{% extends "base_title.html" %}
|
||||||
{% load staticfiles %}
|
{% load static %}
|
||||||
|
|
||||||
{% block realcontent %}
|
{% block realcontent %}
|
||||||
<h2>État des inscriptions BdA</h2>
|
<h2>État des inscriptions BdA</h2>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base_title.html" %}
|
{% extends "base_title.html" %}
|
||||||
{% load staticfiles %}
|
{% load static %}
|
||||||
|
|
||||||
{% block extra_head %}
|
{% block extra_head %}
|
||||||
<script type="text/javascript" src="{% static 'vendor/jquery/jquery-ui.min.js' %}" ></script>
|
<script type="text/javascript" src="{% static 'vendor/jquery/jquery-ui.min.js' %}" ></script>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base_title.html" %}
|
{% extends "base_title.html" %}
|
||||||
{% load staticfiles %}
|
{% load static %}
|
||||||
|
|
||||||
{% block realcontent %}
|
{% block realcontent %}
|
||||||
<h2>{{ spectacle }}</h2>
|
<h2>{{ spectacle }}</h2>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base_title.html" %}
|
{% extends "base_title.html" %}
|
||||||
{% load staticfiles %}
|
{% load static %}
|
||||||
|
|
||||||
|
|
||||||
{%block realcontent %}
|
{%block realcontent %}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base_title.html" %}
|
{% extends "base_title.html" %}
|
||||||
{% load staticfiles %}
|
{% load static %}
|
||||||
|
|
||||||
{% block realcontent %}
|
{% block realcontent %}
|
||||||
<h2>Inscription à une revente</h2>
|
<h2>Inscription à une revente</h2>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base_title.html" %}
|
{% extends "base_title.html" %}
|
||||||
{% load staticfiles %}
|
{% load static %}
|
||||||
|
|
||||||
{% block realcontent %}
|
{% block realcontent %}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base_title.html" %}
|
{% extends "base_title.html" %}
|
||||||
{% load staticfiles %}
|
{% load static %}
|
||||||
|
|
||||||
{% block realcontent %}
|
{% block realcontent %}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base_title.html" %}
|
{% extends "base_title.html" %}
|
||||||
{% load staticfiles%}
|
{% load static %}
|
||||||
|
|
||||||
{% block realcontent %}
|
{% block realcontent %}
|
||||||
<h2>Inscriptions pour BdA-Revente</h2>
|
<h2>Inscriptions pour BdA-Revente</h2>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base_title.html" %}
|
{% extends "base_title.html" %}
|
||||||
{% load staticfiles %}
|
{% load static %}
|
||||||
|
|
||||||
{% block realcontent %}
|
{% block realcontent %}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base_title.html" %}
|
{% extends "base_title.html" %}
|
||||||
{% load staticfiles %}
|
{% load static %}
|
||||||
|
|
||||||
{% block extra_head %}
|
{% block extra_head %}
|
||||||
<link type="text/css" rel="stylesheet" href="{% static "bda/css/bda.css" %}" />
|
<link type="text/css" rel="stylesheet" href="{% static "bda/css/bda.css" %}" />
|
||||||
|
|
42
bda/urls.py
42
bda/urls.py
|
@ -1,74 +1,80 @@
|
||||||
from django.conf.urls import url
|
from django.urls import re_path
|
||||||
|
|
||||||
from bda import views
|
from bda import views
|
||||||
from bda.views import SpectacleListView
|
from bda.views import SpectacleListView
|
||||||
from gestioncof.decorators import buro_required
|
from gestioncof.decorators import buro_required
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(
|
re_path(
|
||||||
r"^inscription/(?P<tirage_id>\d+)$",
|
r"^inscription/(?P<tirage_id>\d+)$",
|
||||||
views.inscription,
|
views.inscription,
|
||||||
name="bda-tirage-inscription",
|
name="bda-tirage-inscription",
|
||||||
),
|
),
|
||||||
url(r"^places/(?P<tirage_id>\d+)$", views.places, name="bda-places-attribuees"),
|
re_path(r"^places/(?P<tirage_id>\d+)$", views.places, name="bda-places-attribuees"),
|
||||||
url(r"^etat-places/(?P<tirage_id>\d+)$", views.etat_places, name="bda-etat-places"),
|
re_path(
|
||||||
url(r"^tirage/(?P<tirage_id>\d+)$", views.tirage, name="bda-tirage"),
|
r"^etat-places/(?P<tirage_id>\d+)$", views.etat_places, name="bda-etat-places"
|
||||||
url(
|
),
|
||||||
|
re_path(r"^tirage/(?P<tirage_id>\d+)$", views.tirage, name="bda-tirage"),
|
||||||
|
re_path(
|
||||||
r"^spectacles/(?P<tirage_id>\d+)$",
|
r"^spectacles/(?P<tirage_id>\d+)$",
|
||||||
buro_required(SpectacleListView.as_view()),
|
buro_required(SpectacleListView.as_view()),
|
||||||
name="bda-liste-spectacles",
|
name="bda-liste-spectacles",
|
||||||
),
|
),
|
||||||
url(
|
re_path(
|
||||||
r"^spectacles/(?P<tirage_id>\d+)/(?P<spectacle_id>\d+)$",
|
r"^spectacles/(?P<tirage_id>\d+)/(?P<spectacle_id>\d+)$",
|
||||||
views.spectacle,
|
views.spectacle,
|
||||||
name="bda-spectacle",
|
name="bda-spectacle",
|
||||||
),
|
),
|
||||||
url(
|
re_path(
|
||||||
r"^spectacles/unpaid/(?P<tirage_id>\d+)$",
|
r"^spectacles/unpaid/(?P<tirage_id>\d+)$",
|
||||||
views.UnpaidParticipants.as_view(),
|
views.UnpaidParticipants.as_view(),
|
||||||
name="bda-unpaid",
|
name="bda-unpaid",
|
||||||
),
|
),
|
||||||
url(
|
re_path(
|
||||||
r"^spectacles/autocomplete$",
|
r"^spectacles/autocomplete$",
|
||||||
views.spectacle_autocomplete,
|
views.spectacle_autocomplete,
|
||||||
name="bda-spectacle-autocomplete",
|
name="bda-spectacle-autocomplete",
|
||||||
),
|
),
|
||||||
url(
|
re_path(
|
||||||
r"^participants/autocomplete$",
|
r"^participants/autocomplete$",
|
||||||
views.participant_autocomplete,
|
views.participant_autocomplete,
|
||||||
name="bda-participant-autocomplete",
|
name="bda-participant-autocomplete",
|
||||||
),
|
),
|
||||||
# Urls BdA-Revente
|
# Urls BdA-Revente
|
||||||
url(
|
re_path(
|
||||||
r"^revente/(?P<tirage_id>\d+)/manage$",
|
r"^revente/(?P<tirage_id>\d+)/manage$",
|
||||||
views.revente_manage,
|
views.revente_manage,
|
||||||
name="bda-revente-manage",
|
name="bda-revente-manage",
|
||||||
),
|
),
|
||||||
url(
|
re_path(
|
||||||
r"^revente/(?P<tirage_id>\d+)/subscribe$",
|
r"^revente/(?P<tirage_id>\d+)/subscribe$",
|
||||||
views.revente_subscribe,
|
views.revente_subscribe,
|
||||||
name="bda-revente-subscribe",
|
name="bda-revente-subscribe",
|
||||||
),
|
),
|
||||||
url(
|
re_path(
|
||||||
r"^revente/(?P<tirage_id>\d+)/tirages$",
|
r"^revente/(?P<tirage_id>\d+)/tirages$",
|
||||||
views.revente_tirages,
|
views.revente_tirages,
|
||||||
name="bda-revente-tirages",
|
name="bda-revente-tirages",
|
||||||
),
|
),
|
||||||
url(
|
re_path(
|
||||||
r"^revente/(?P<spectacle_id>\d+)/buy$",
|
r"^revente/(?P<spectacle_id>\d+)/buy$",
|
||||||
views.revente_buy,
|
views.revente_buy,
|
||||||
name="bda-revente-buy",
|
name="bda-revente-buy",
|
||||||
),
|
),
|
||||||
url(
|
re_path(
|
||||||
r"^revente/(?P<revente_id>\d+)/confirm$",
|
r"^revente/(?P<revente_id>\d+)/confirm$",
|
||||||
views.revente_confirm,
|
views.revente_confirm,
|
||||||
name="bda-revente-confirm",
|
name="bda-revente-confirm",
|
||||||
),
|
),
|
||||||
url(
|
re_path(
|
||||||
r"^revente/(?P<tirage_id>\d+)/shotgun$",
|
r"^revente/(?P<tirage_id>\d+)/shotgun$",
|
||||||
views.revente_shotgun,
|
views.revente_shotgun,
|
||||||
name="bda-revente-shotgun",
|
name="bda-revente-shotgun",
|
||||||
),
|
),
|
||||||
url(r"^mails-rappel/(?P<spectacle_id>\d+)$", views.send_rappel, name="bda-rappels"),
|
re_path(
|
||||||
url(r"^catalogue/(?P<request_type>[a-z]+)$", views.catalogue, name="bda-catalogue"),
|
r"^mails-rappel/(?P<spectacle_id>\d+)$", views.send_rappel, name="bda-rappels"
|
||||||
|
),
|
||||||
|
re_path(
|
||||||
|
r"^catalogue/(?P<request_type>[a-z]+)$", views.catalogue, name="bda-catalogue"
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -274,13 +274,13 @@ def do_tirage(tirage_elt, token):
|
||||||
results = Algorithm(data["shows"], data["members"], choices)(token)
|
results = Algorithm(data["shows"], data["members"], choices)(token)
|
||||||
|
|
||||||
# On compte les places attribuées et les déçus
|
# On compte les places attribuées et les déçus
|
||||||
for (_, members, losers) in results:
|
for _, members, losers in results:
|
||||||
data["total_slots"] += len(members)
|
data["total_slots"] += len(members)
|
||||||
data["total_losers"] += len(losers)
|
data["total_losers"] += len(losers)
|
||||||
|
|
||||||
# On calcule le déficit et les bénéfices pour le BdA
|
# On calcule le déficit et les bénéfices pour le BdA
|
||||||
# FIXME: le traitement de l'opéra est sale
|
# FIXME: le traitement de l'opéra est sale
|
||||||
for (show, members, _) in results:
|
for show, members, _ in results:
|
||||||
deficit = (show.slots - len(members)) * show.price
|
deficit = (show.slots - len(members)) * show.price
|
||||||
data["total_sold"] += show.slots * show.price
|
data["total_sold"] += show.slots * show.price
|
||||||
if deficit >= 0:
|
if deficit >= 0:
|
||||||
|
@ -293,8 +293,8 @@ def do_tirage(tirage_elt, token):
|
||||||
# so assign a single object for each Participant id
|
# so assign a single object for each Participant id
|
||||||
members_uniq = {}
|
members_uniq = {}
|
||||||
members2 = {}
|
members2 = {}
|
||||||
for (show, members, _) in results:
|
for show, members, _ in results:
|
||||||
for (member, _, _, _) in members:
|
for member, _, _, _ in members:
|
||||||
if member.id not in members_uniq:
|
if member.id not in members_uniq:
|
||||||
members_uniq[member.id] = member
|
members_uniq[member.id] = member
|
||||||
members2[member] = []
|
members2[member] = []
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
default_app_config = "bds.apps.BdsConfig"
|
|
|
@ -1,5 +1,4 @@
|
||||||
from django import apps as global_apps
|
from django.apps import AppConfig, apps as global_apps
|
||||||
from django.apps import AppConfig
|
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
from django.db.models.signals import post_migrate
|
from django.db.models.signals import post_migrate
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ import bds.models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
initial = True
|
initial = True
|
||||||
|
|
||||||
dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL)]
|
dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL)]
|
||||||
|
|
|
@ -9,7 +9,6 @@ def create_bds_buro_group(apps, schema_editor):
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("bds", "0001_initial")]
|
dependencies = [("bds", "0001_initial")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("bds", "0002_bds_group"),
|
("bds", "0002_bds_group"),
|
||||||
]
|
]
|
||||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("bds", "0003_staff_permission"),
|
("bds", "0003_staff_permission"),
|
||||||
]
|
]
|
||||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("bds", "0004_is_member_cotiz_type"),
|
("bds", "0004_is_member_cotiz_type"),
|
||||||
]
|
]
|
||||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("bds", "0005_remove_bdsprofile_certificate_file"),
|
("bds", "0005_remove_bdsprofile_certificate_file"),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% load staticfiles %}
|
{% load static %}
|
||||||
{% load bulma_utils %}
|
{% load bulma_utils %}
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
|
@ -31,7 +31,7 @@ class TestHomeView(TestCase):
|
||||||
user, backend="django.contrib.auth.backends.ModelBackend"
|
user, backend="django.contrib.auth.backends.ModelBackend"
|
||||||
)
|
)
|
||||||
resp = self.client.get(reverse("bds:home"))
|
resp = self.client.get(reverse("bds:home"))
|
||||||
self.assertEquals(resp.status_code, 200)
|
self.assertEqual(resp.status_code, 200)
|
||||||
|
|
||||||
|
|
||||||
class TestRegistrationView(TestCase):
|
class TestRegistrationView(TestCase):
|
||||||
|
@ -48,12 +48,12 @@ class TestRegistrationView(TestCase):
|
||||||
# Logged-in but unprivileged GET
|
# Logged-in but unprivileged GET
|
||||||
client.force_login(user, backend="django.contrib.auth.backends.ModelBackend")
|
client.force_login(user, backend="django.contrib.auth.backends.ModelBackend")
|
||||||
resp = client.get(url)
|
resp = client.get(url)
|
||||||
self.assertEquals(resp.status_code, 403)
|
self.assertEqual(resp.status_code, 403)
|
||||||
|
|
||||||
# Burô user GET
|
# Burô user GET
|
||||||
give_bds_buro_permissions(user)
|
give_bds_buro_permissions(user)
|
||||||
resp = client.get(url)
|
resp = client.get(url)
|
||||||
self.assertEquals(resp.status_code, 200)
|
self.assertEqual(resp.status_code, 200)
|
||||||
|
|
||||||
@mock.patch("gestioncof.signals.messages")
|
@mock.patch("gestioncof.signals.messages")
|
||||||
def test_get(self, mock_messages):
|
def test_get(self, mock_messages):
|
||||||
|
@ -68,9 +68,9 @@ class TestRegistrationView(TestCase):
|
||||||
# Logged-in but unprivileged GET
|
# Logged-in but unprivileged GET
|
||||||
client.force_login(user, backend="django.contrib.auth.backends.ModelBackend")
|
client.force_login(user, backend="django.contrib.auth.backends.ModelBackend")
|
||||||
resp = client.get(url)
|
resp = client.get(url)
|
||||||
self.assertEquals(resp.status_code, 403)
|
self.assertEqual(resp.status_code, 403)
|
||||||
|
|
||||||
# Burô user GET
|
# Burô user GET
|
||||||
give_bds_buro_permissions(user)
|
give_bds_buro_permissions(user)
|
||||||
resp = client.get(url)
|
resp = client.get(url)
|
||||||
self.assertEquals(resp.status_code, 200)
|
self.assertEqual(resp.status_code, 200)
|
||||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
initial = True
|
initial = True
|
||||||
|
|
||||||
dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL)]
|
dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL)]
|
||||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
initial = True
|
initial = True
|
||||||
|
|
||||||
dependencies = []
|
dependencies = []
|
||||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
("events", "0001_event"),
|
("events", "0001_event"),
|
||||||
|
|
|
@ -6,7 +6,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
("events", "0002_event_subscribers"),
|
("events", "0002_event_subscribers"),
|
||||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
("events", "0003_options_and_extra_fields"),
|
("events", "0003_options_and_extra_fields"),
|
||||||
|
|
63
events/migrations/0005_auto_20220630_1239.py
Normal file
63
events/migrations/0005_auto_20220630_1239.py
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
# Generated by Django 3.2.13 on 2022-06-30 10:39
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
("events", "0004_unique_constraints"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterUniqueTogether(
|
||||||
|
name="extrafield",
|
||||||
|
unique_together=set(),
|
||||||
|
),
|
||||||
|
migrations.AlterUniqueTogether(
|
||||||
|
name="extrafieldcontent",
|
||||||
|
unique_together=set(),
|
||||||
|
),
|
||||||
|
migrations.AlterUniqueTogether(
|
||||||
|
name="option",
|
||||||
|
unique_together=set(),
|
||||||
|
),
|
||||||
|
migrations.AlterUniqueTogether(
|
||||||
|
name="optionchoice",
|
||||||
|
unique_together=set(),
|
||||||
|
),
|
||||||
|
migrations.AlterUniqueTogether(
|
||||||
|
name="registration",
|
||||||
|
unique_together=set(),
|
||||||
|
),
|
||||||
|
migrations.AddConstraint(
|
||||||
|
model_name="extrafield",
|
||||||
|
constraint=models.UniqueConstraint(
|
||||||
|
fields=("event", "name"), name="unique_extra_field"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
migrations.AddConstraint(
|
||||||
|
model_name="extrafieldcontent",
|
||||||
|
constraint=models.UniqueConstraint(
|
||||||
|
fields=("field", "registration"), name="unique_extra_field_content"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
migrations.AddConstraint(
|
||||||
|
model_name="option",
|
||||||
|
constraint=models.UniqueConstraint(
|
||||||
|
fields=("event", "name"), name="unique_event_option"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
migrations.AddConstraint(
|
||||||
|
model_name="optionchoice",
|
||||||
|
constraint=models.UniqueConstraint(
|
||||||
|
fields=("option", "choice"), name="unique_option_choice"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
migrations.AddConstraint(
|
||||||
|
model_name="registration",
|
||||||
|
constraint=models.UniqueConstraint(
|
||||||
|
fields=("event", "user"), name="unique_registration"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
|
@ -72,9 +72,13 @@ class Option(models.Model):
|
||||||
multi_choices = models.BooleanField(_("choix multiples"), default=False)
|
multi_choices = models.BooleanField(_("choix multiples"), default=False)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
constraints = [
|
||||||
|
models.UniqueConstraint(
|
||||||
|
fields=["event", "name"], name="unique_event_option"
|
||||||
|
)
|
||||||
|
]
|
||||||
verbose_name = _("option d'événement")
|
verbose_name = _("option d'événement")
|
||||||
verbose_name_plural = _("options d'événement")
|
verbose_name_plural = _("options d'événement")
|
||||||
unique_together = [["event", "name"]]
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
@ -87,9 +91,13 @@ class OptionChoice(models.Model):
|
||||||
choice = models.CharField(_("choix"), max_length=200)
|
choice = models.CharField(_("choix"), max_length=200)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
constraints = [
|
||||||
|
models.UniqueConstraint(
|
||||||
|
fields=["option", "choice"], name="unique_option_choice"
|
||||||
|
)
|
||||||
|
]
|
||||||
verbose_name = _("choix d'option d'événement")
|
verbose_name = _("choix d'option d'événement")
|
||||||
verbose_name_plural = _("choix d'option d'événement")
|
verbose_name_plural = _("choix d'option d'événement")
|
||||||
unique_together = [["option", "choice"]]
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.choice
|
return self.choice
|
||||||
|
@ -118,7 +126,9 @@ class ExtraField(models.Model):
|
||||||
field_type = models.CharField(_("type de champ"), max_length=9, choices=FIELD_TYPE)
|
field_type = models.CharField(_("type de champ"), max_length=9, choices=FIELD_TYPE)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
unique_together = [["event", "name"]]
|
constraints = [
|
||||||
|
models.UniqueConstraint(fields=["event", "name"], name="unique_extra_field")
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
class ExtraFieldContent(models.Model):
|
class ExtraFieldContent(models.Model):
|
||||||
|
@ -137,9 +147,13 @@ class ExtraFieldContent(models.Model):
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
constraints = [
|
||||||
|
models.UniqueConstraint(
|
||||||
|
fields=["field", "registration"], name="unique_extra_field_content"
|
||||||
|
)
|
||||||
|
]
|
||||||
verbose_name = _("contenu d'un champ événement supplémentaire")
|
verbose_name = _("contenu d'un champ événement supplémentaire")
|
||||||
verbose_name_plural = _("contenus d'un champ événement supplémentaire")
|
verbose_name_plural = _("contenus d'un champ événement supplémentaire")
|
||||||
unique_together = [["field", "registration"]]
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
max_length = 50
|
max_length = 50
|
||||||
|
@ -163,9 +177,13 @@ class Registration(models.Model):
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
constraints = [
|
||||||
|
models.UniqueConstraint(
|
||||||
|
fields=["event", "user"], name="unique_registration"
|
||||||
|
)
|
||||||
|
]
|
||||||
verbose_name = _("inscription à un événement")
|
verbose_name = _("inscription à un événement")
|
||||||
verbose_name_plural = _("inscriptions à un événement")
|
verbose_name_plural = _("inscriptions à un événement")
|
||||||
unique_together = [["event", "user"]]
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "inscription de {} à {}".format(self.user, self.event)
|
return "inscription de {} à {}".format(self.user, self.event)
|
||||||
|
|
|
@ -1,8 +1,15 @@
|
||||||
|
"""
|
||||||
|
ASGI entrypoint. Configures Django and then runs the application
|
||||||
|
defined in the ASGI_APPLICATION setting.
|
||||||
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from channels.asgi import get_channel_layer
|
import django
|
||||||
|
from channels.routing import get_default_application
|
||||||
|
|
||||||
if "DJANGO_SETTINGS_MODULE" not in os.environ:
|
if "DJANGO_SETTINGS_MODULE" not in os.environ:
|
||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gestioasso.settings")
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gestioasso.settings.local")
|
||||||
|
|
||||||
channel_layer = get_channel_layer()
|
django.setup()
|
||||||
|
application = get_default_application()
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
from channels.routing import include
|
from channels.auth import AuthMiddlewareStack
|
||||||
|
from channels.routing import ProtocolTypeRouter, URLRouter
|
||||||
|
from django.core.asgi import get_asgi_application
|
||||||
|
from django.urls import path
|
||||||
|
|
||||||
routing = [include("kfet.routing.routing", path=r"^/ws/k-fet")]
|
from kfet.routing import KFRouter
|
||||||
|
|
||||||
|
application = ProtocolTypeRouter(
|
||||||
|
{
|
||||||
|
# WebSocket chat handler
|
||||||
|
"websocket": AuthMiddlewareStack(
|
||||||
|
URLRouter(
|
||||||
|
[
|
||||||
|
path("ws/k-fet", KFRouter),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
),
|
||||||
|
"http": get_asgi_application(),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
|
@ -7,6 +7,8 @@ Surcharge les settings définis dans common.py
|
||||||
import os
|
import os
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
|
from django.utils import timezone
|
||||||
|
|
||||||
from .common import * # NOQA
|
from .common import * # NOQA
|
||||||
from .common import (
|
from .common import (
|
||||||
AUTHENTICATION_BACKENDS,
|
AUTHENTICATION_BACKENDS,
|
||||||
|
@ -83,7 +85,6 @@ MIDDLEWARE = (
|
||||||
+ MIDDLEWARE
|
+ MIDDLEWARE
|
||||||
+ [
|
+ [
|
||||||
"djconfig.middleware.DjConfigMiddleware",
|
"djconfig.middleware.DjConfigMiddleware",
|
||||||
"wagtail.core.middleware.SiteMiddleware",
|
|
||||||
"wagtail.contrib.redirects.middleware.RedirectMiddleware",
|
"wagtail.contrib.redirects.middleware.RedirectMiddleware",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
@ -107,6 +108,8 @@ MEDIA_URL = "/gestion/media/"
|
||||||
CORS_ORIGIN_WHITELIST = ("bda.ens.fr", "www.bda.ens.fr" "cof.ens.fr", "www.cof.ens.fr")
|
CORS_ORIGIN_WHITELIST = ("bda.ens.fr", "www.bda.ens.fr" "cof.ens.fr", "www.cof.ens.fr")
|
||||||
|
|
||||||
|
|
||||||
|
ASGI_APPLICATION = "gestioasso.routing.application"
|
||||||
|
|
||||||
# ---
|
# ---
|
||||||
# Auth-related stuff
|
# Auth-related stuff
|
||||||
# ---
|
# ---
|
||||||
|
@ -145,7 +148,7 @@ CACHES = {
|
||||||
|
|
||||||
CHANNEL_LAYERS = {
|
CHANNEL_LAYERS = {
|
||||||
"default": {
|
"default": {
|
||||||
"BACKEND": "asgi_redis.RedisChannelLayer",
|
"BACKEND": "shared.channels.ChannelLayer",
|
||||||
"CONFIG": {
|
"CONFIG": {
|
||||||
"hosts": [
|
"hosts": [
|
||||||
(
|
(
|
||||||
|
@ -158,11 +161,9 @@ CHANNEL_LAYERS = {
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"ROUTING": "gestioasso.routing.routing",
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# ---
|
# ---
|
||||||
# reCAPTCHA settings
|
# reCAPTCHA settings
|
||||||
# https://github.com/praekelt/django-recaptcha
|
# https://github.com/praekelt/django-recaptcha
|
||||||
|
@ -204,8 +205,9 @@ MAIL_DATA = {
|
||||||
"REPLYTO": "cof@ens.fr",
|
"REPLYTO": "cof@ens.fr",
|
||||||
},
|
},
|
||||||
"rappels": {"FROM": "Le BdA <bda@ens.fr>", "REPLYTO": "Le BdA <bda@ens.fr>"},
|
"rappels": {"FROM": "Le BdA <bda@ens.fr>", "REPLYTO": "Le BdA <bda@ens.fr>"},
|
||||||
"rappel_negatif": {
|
"kfet": {
|
||||||
"FROM": "La K-Fêt <k-fet@ens.fr>",
|
"FROM": "La K-Fêt <chefs-k-fet@ens.fr>",
|
||||||
|
"REPLYTO": "La K-Fêt <chefs-k-fet@ens.fr>",
|
||||||
},
|
},
|
||||||
"revente": {
|
"revente": {
|
||||||
"FROM": "BdA-Revente <bda-revente@ens.fr>",
|
"FROM": "BdA-Revente <bda-revente@ens.fr>",
|
||||||
|
@ -224,3 +226,8 @@ KFET_HISTORY_DATE_LIMIT = timedelta(days=7)
|
||||||
# Limite plus longue pour les chefs/trez
|
# Limite plus longue pour les chefs/trez
|
||||||
# (qui ont la permission kfet.access_old_history)
|
# (qui ont la permission kfet.access_old_history)
|
||||||
KFET_HISTORY_LONG_DATE_LIMIT = timedelta(days=30)
|
KFET_HISTORY_LONG_DATE_LIMIT = timedelta(days=30)
|
||||||
|
|
||||||
|
# These accounts don't represent actual people and can be freely accessed
|
||||||
|
# Identification based on trigrammes
|
||||||
|
KFET_HISTORY_NO_DATE_LIMIT_TRIGRAMMES = ["LIQ", "#13"]
|
||||||
|
KFET_HISTORY_NO_DATE_LIMIT = timezone.datetime(1794, 10, 30) # AKA the distant past
|
||||||
|
|
|
@ -101,7 +101,7 @@ TEMPLATES = [
|
||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
"default": {
|
"default": {
|
||||||
"ENGINE": "django.db.backends.postgresql_psycopg2",
|
"ENGINE": "django.db.backends.postgresql",
|
||||||
"NAME": DBNAME,
|
"NAME": DBNAME,
|
||||||
"USER": DBUSER,
|
"USER": DBUSER,
|
||||||
"PASSWORD": DBPASSWD,
|
"PASSWORD": DBPASSWD,
|
||||||
|
@ -111,6 +111,7 @@ DATABASES = {
|
||||||
|
|
||||||
SITE_ID = 1
|
SITE_ID = 1
|
||||||
|
|
||||||
|
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
|
||||||
|
|
||||||
# ---
|
# ---
|
||||||
# Internationalization
|
# Internationalization
|
||||||
|
|
|
@ -47,8 +47,7 @@ CACHES = {"default": {"BACKEND": "django.core.cache.backends.locmem.LocMemCache"
|
||||||
# Use the default in memory asgi backend for local development
|
# Use the default in memory asgi backend for local development
|
||||||
CHANNEL_LAYERS = {
|
CHANNEL_LAYERS = {
|
||||||
"default": {
|
"default": {
|
||||||
"BACKEND": "asgiref.inmemory.ChannelLayer",
|
"BACKEND": "channels.layers.InMemoryChannelLayer",
|
||||||
"ROUTING": "gestioasso.routing.routing",
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ app_dict = {
|
||||||
"events": "gestion/event_v2/", # the events module is still experimental !
|
"events": "gestion/event_v2/", # the events module is still experimental !
|
||||||
"authens": "gestion/authens/",
|
"authens": "gestion/authens/",
|
||||||
}
|
}
|
||||||
for (app_name, url_prefix) in app_dict.items():
|
for app_name, url_prefix in app_dict.items():
|
||||||
if app_name in settings.INSTALLED_APPS:
|
if app_name in settings.INSTALLED_APPS:
|
||||||
urlpatterns += [path(url_prefix, include("{}.urls".format(app_name)))]
|
urlpatterns += [path(url_prefix, include("{}.urls".format(app_name)))]
|
||||||
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
default_app_config = "gestioncof.apps.GestioncofConfig"
|
|
|
@ -6,7 +6,7 @@ from django.contrib.auth.models import Group, Permission, User
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.utils.safestring import mark_safe
|
from django.utils.safestring import mark_safe
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
from gestioncof.models import (
|
from gestioncof.models import (
|
||||||
Club,
|
Club,
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
default_app_config = "gestioncof.cms.apps.COFCMSAppConfig"
|
|
|
@ -13,7 +13,6 @@ import gestioncof.cms.models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
initial = True
|
initial = True
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("cofcms", "0001_initial")]
|
dependencies = [("cofcms", "0001_initial")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -6,7 +6,6 @@ from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("cofcms", "0002_auto_20190523_1521"),
|
("cofcms", "0002_auto_20190523_1521"),
|
||||||
]
|
]
|
||||||
|
|
|
@ -6,7 +6,6 @@ from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("cofcms", "0003_directory_entry_optional_links"),
|
("cofcms", "0003_directory_entry_optional_links"),
|
||||||
]
|
]
|
||||||
|
|
|
@ -2,7 +2,7 @@ from datetime import date, timedelta
|
||||||
|
|
||||||
from django import template
|
from django import template
|
||||||
from django.utils import formats, timezone
|
from django.utils import formats, timezone
|
||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import gettext as _
|
||||||
|
|
||||||
from ..models import COFActuPage, COFRootPage
|
from ..models import COFActuPage, COFRootPage
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ from django.contrib.auth import get_user_model
|
||||||
from django.contrib.auth.forms import AuthenticationForm
|
from django.contrib.auth.forms import AuthenticationForm
|
||||||
from django.forms.formsets import BaseFormSet, formset_factory
|
from django.forms.formsets import BaseFormSet, formset_factory
|
||||||
from django.forms.widgets import CheckboxSelectMultiple, RadioSelect
|
from django.forms.widgets import CheckboxSelectMultiple, RadioSelect
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from djconfig.forms import ConfigForm
|
from djconfig.forms import ConfigForm
|
||||||
|
|
||||||
from bda.models import Spectacle
|
from bda.models import Spectacle
|
||||||
|
@ -276,7 +276,9 @@ class RegistrationProfileForm(forms.ModelForm):
|
||||||
self.fields["mailing_bda_revente"].initial = True
|
self.fields["mailing_bda_revente"].initial = True
|
||||||
self.fields["mailing_unernestaparis"].initial = True
|
self.fields["mailing_unernestaparis"].initial = True
|
||||||
|
|
||||||
self.fields.keyOrder = [
|
class Meta:
|
||||||
|
model = CofProfile
|
||||||
|
fields = [
|
||||||
"login_clipper",
|
"login_clipper",
|
||||||
"phone",
|
"phone",
|
||||||
"occupation",
|
"occupation",
|
||||||
|
@ -290,22 +292,6 @@ class RegistrationProfileForm(forms.ModelForm):
|
||||||
"comments",
|
"comments",
|
||||||
]
|
]
|
||||||
|
|
||||||
class Meta:
|
|
||||||
model = CofProfile
|
|
||||||
fields = (
|
|
||||||
"login_clipper",
|
|
||||||
"phone",
|
|
||||||
"occupation",
|
|
||||||
"departement",
|
|
||||||
"is_cof",
|
|
||||||
"type_cotiz",
|
|
||||||
"mailing_cof",
|
|
||||||
"mailing_bda",
|
|
||||||
"mailing_bda_revente",
|
|
||||||
"mailing_unernestaparis",
|
|
||||||
"comments",
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
STATUS_CHOICES = (
|
STATUS_CHOICES = (
|
||||||
("no", "Non"),
|
("no", "Non"),
|
||||||
|
|
|
@ -6,7 +6,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL)]
|
dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL)]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("gestioncof", "0001_initial")]
|
dependencies = [("gestioncof", "0001_initial")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("gestioncof", "0002_enable_unprocessed_demandes")]
|
dependencies = [("gestioncof", "0002_enable_unprocessed_demandes")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -25,7 +25,6 @@ def create_mail(apps, schema_editor):
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("gestioncof", "0003_event_image")]
|
dependencies = [("gestioncof", "0003_event_image")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("gestioncof", "0004_registration_mail")]
|
dependencies = [("gestioncof", "0004_registration_mail")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -6,7 +6,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("bda", "0004_mails-rappel"),
|
("bda", "0004_mails-rappel"),
|
||||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
|
|
|
@ -6,7 +6,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("gestioncof", "0006_add_calendar")]
|
dependencies = [("gestioncof", "0006_add_calendar")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -10,7 +10,6 @@ def forwards(apps, schema_editor):
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("gestioncof", "0007_alter_club")]
|
dependencies = [("gestioncof", "0007_alter_club")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("gestioncof", "0008_py3")]
|
dependencies = [("gestioncof", "0008_py3")]
|
||||||
|
|
||||||
operations = [migrations.DeleteModel(name="Clipper")]
|
operations = [migrations.DeleteModel(name="Clipper")]
|
||||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("gestioncof", "0009_delete_clipper")]
|
dependencies = [("gestioncof", "0009_delete_clipper")]
|
||||||
|
|
||||||
operations = [migrations.DeleteModel(name="CustomMail")]
|
operations = [migrations.DeleteModel(name="CustomMail")]
|
||||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("gestioncof", "0010_delete_custommail")]
|
dependencies = [("gestioncof", "0010_delete_custommail")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("gestioncof", "0010_delete_custommail")]
|
dependencies = [("gestioncof", "0010_delete_custommail")]
|
||||||
|
|
||||||
operations = [migrations.RemoveField(model_name="cofprofile", name="num")]
|
operations = [migrations.RemoveField(model_name="cofprofile", name="num")]
|
||||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("gestioncof", "0011_remove_cofprofile_num"),
|
("gestioncof", "0011_remove_cofprofile_num"),
|
||||||
("gestioncof", "0011_longer_clippers"),
|
("gestioncof", "0011_longer_clippers"),
|
||||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("gestioncof", "0012_merge")]
|
dependencies = [("gestioncof", "0012_merge")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -6,7 +6,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("gestioncof", "0013_pei")]
|
dependencies = [("gestioncof", "0013_pei")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -6,7 +6,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("gestioncof", "0014_cofprofile_mailing_unernestaparis")]
|
dependencies = [("gestioncof", "0014_cofprofile_mailing_unernestaparis")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -16,7 +16,6 @@ def null_clippers_to_empty(apps, schema_editor):
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [("gestioncof", "0015_psql_choices_niveaux")]
|
dependencies = [("gestioncof", "0015_psql_choices_niveaux")]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
("gestioncof", "0016_unique_clippers"),
|
("gestioncof", "0016_unique_clippers"),
|
||||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("gestioncof", "0017_petitscours_uniqueness"),
|
("gestioncof", "0017_petitscours_uniqueness"),
|
||||||
]
|
]
|
||||||
|
|
43
gestioncof/migrations/0019_auto_20220630_1241.py
Normal file
43
gestioncof/migrations/0019_auto_20220630_1241.py
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
# Generated by Django 3.2.13 on 2022-06-30 10:41
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
("gestioncof", "0018_petitscours_email"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterUniqueTogether(
|
||||||
|
name="eventregistration",
|
||||||
|
unique_together=set(),
|
||||||
|
),
|
||||||
|
migrations.AlterUniqueTogether(
|
||||||
|
name="petitcoursability",
|
||||||
|
unique_together=set(),
|
||||||
|
),
|
||||||
|
migrations.AlterUniqueTogether(
|
||||||
|
name="surveyanswer",
|
||||||
|
unique_together=set(),
|
||||||
|
),
|
||||||
|
migrations.AddConstraint(
|
||||||
|
model_name="eventregistration",
|
||||||
|
constraint=models.UniqueConstraint(
|
||||||
|
fields=("user", "event"), name="unique_event_registration"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
migrations.AddConstraint(
|
||||||
|
model_name="petitcoursability",
|
||||||
|
constraint=models.UniqueConstraint(
|
||||||
|
fields=("user", "niveau", "matiere"), name="unique_competence_level"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
migrations.AddConstraint(
|
||||||
|
model_name="surveyanswer",
|
||||||
|
constraint=models.UniqueConstraint(
|
||||||
|
fields=("user", "survey"), name="unique_survey_answer"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
19
gestioncof/migrations/0019_cofprofile_date_adhesion.py
Normal file
19
gestioncof/migrations/0019_cofprofile_date_adhesion.py
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
# Generated by Django 2.2.28 on 2023-05-22 09:01
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
dependencies = [
|
||||||
|
("gestioncof", "0018_petitscours_email"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name="cofprofile",
|
||||||
|
name="date_adhesion",
|
||||||
|
field=models.DateField(
|
||||||
|
blank=True, null=True, verbose_name="Date d'adhésion"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
|
@ -2,7 +2,7 @@ from django.contrib.auth.models import User
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.db.models.signals import post_delete, post_save
|
from django.db.models.signals import post_delete, post_save
|
||||||
from django.dispatch import receiver
|
from django.dispatch import receiver
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
from bda.models import Spectacle
|
from bda.models import Spectacle
|
||||||
from shared.utils import choices_length
|
from shared.utils import choices_length
|
||||||
|
@ -50,6 +50,7 @@ class CofProfile(models.Model):
|
||||||
"Login clipper", max_length=32, blank=True, unique=True, null=True
|
"Login clipper", max_length=32, blank=True, unique=True, null=True
|
||||||
)
|
)
|
||||||
is_cof = models.BooleanField("Membre du COF", default=False)
|
is_cof = models.BooleanField("Membre du COF", default=False)
|
||||||
|
date_adhesion = models.DateField("Date d'adhésion", blank=True, null=True)
|
||||||
phone = models.CharField("Téléphone", max_length=20, blank=True)
|
phone = models.CharField("Téléphone", max_length=20, blank=True)
|
||||||
occupation = models.CharField(
|
occupation = models.CharField(
|
||||||
_("Occupation"),
|
_("Occupation"),
|
||||||
|
@ -193,8 +194,12 @@ class EventRegistration(models.Model):
|
||||||
paid = models.BooleanField("A payé", default=False)
|
paid = models.BooleanField("A payé", default=False)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
constraints = [
|
||||||
|
models.UniqueConstraint(
|
||||||
|
fields=["user", "event"], name="unique_event_registration"
|
||||||
|
)
|
||||||
|
]
|
||||||
verbose_name = "Inscription"
|
verbose_name = "Inscription"
|
||||||
unique_together = ("user", "event")
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "Inscription de {} à {}".format(self.user, self.event.title)
|
return "Inscription de {} à {}".format(self.user, self.event.title)
|
||||||
|
@ -246,8 +251,12 @@ class SurveyAnswer(models.Model):
|
||||||
answers = models.ManyToManyField(SurveyQuestionAnswer, related_name="selected_by")
|
answers = models.ManyToManyField(SurveyQuestionAnswer, related_name="selected_by")
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
constraints = [
|
||||||
|
models.UniqueConstraint(
|
||||||
|
fields=["user", "survey"], name="unique_survey_answer"
|
||||||
|
)
|
||||||
|
]
|
||||||
verbose_name = "Réponses"
|
verbose_name = "Réponses"
|
||||||
unique_together = ("user", "survey")
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "Réponse de %s sondage %s" % (
|
return "Réponse de %s sondage %s" % (
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.contrib.auth.signals import user_logged_in
|
from django.contrib.auth.signals import user_logged_in
|
||||||
from django.dispatch import receiver
|
from django.dispatch import receiver
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from django_cas_ng.signals import cas_user_authenticated
|
from django_cas_ng.signals import cas_user_authenticated
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% load staticfiles %}
|
{% load static %}
|
||||||
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr">
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr">
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
{# TODO: Since Django 1.9, we can store result with "as", allowing proper value management (if None) #}
|
{# TODO: Since Django 1.9, we can store result with "as", allowing proper value management (if None) #}
|
||||||
<li><a href="{% slugurl "k-fet" %}">Page d'accueil</a></li>
|
<li><a href="{% slugurl "k-fet" %}">Page d'accueil</a></li>
|
||||||
<li><a href="https://cof.ens.fr/gestion/k-fet/le-calendrier/">Calendrier</a></li>
|
<li><a href="https://cof.ens.fr/gestion/k-fet/le-calendrier/">Calendrier</a></li>
|
||||||
{% if perms.kfet.is_team and user.profile.is_cof %}
|
{% if perms.kfet.is_team %}
|
||||||
<li><a href="{% url 'kfet.kpsul' %}">K-Psul</a></li>
|
<li><a href="{% url 'kfet.kpsul' %}">K-Psul</a></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base_title.html" %}
|
{% extends "base_title.html" %}
|
||||||
{% load staticfiles %}
|
{% load static %}
|
||||||
|
|
||||||
{% block page_size %}col-sm-8{% endblock %}
|
{% block page_size %}col-sm-8{% endblock %}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% load staticfiles %}
|
{% load static %}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var supernifty_tristate = function() {
|
var supernifty_tristate = function() {
|
||||||
var
|
var
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue