Compare commits

..

5 commits

Author SHA1 Message Date
Tom Hubrecht 7460ca591f Merge branch 'master' into 'Production'
Master

See merge request klub-dev-ens/gestioCOF!527
2023-06-15 13:59:53 +02:00
Tom Hubrecht a4494c3648 Merge branch 'master' into 'Production'
Version 0.15

See merge request klub-dev-ens/gestioCOF!524
2023-05-22 20:49:38 +02:00
Tom Hubrecht 1fbf27a9f7 Merge branch 'master' into 'Production'
Mise en production de la v0.14

See merge request klub-dev-ens/gestioCOF!519
2023-05-19 20:24:04 +02:00
Tom Hubrecht 3178657e33 Merge branch 'master' into 'Production'
Update prod

See merge request klub-dev-ens/gestioCOF!517
2023-02-21 21:50:26 +01:00
Tom Hubrecht a4ebeb266a Merge branch 'master' into 'Production'
Mise en production de 0.12.1

See merge request klub-dev-ens/gestioCOF!514
2022-10-03 18:46:49 +02:00
7 changed files with 35 additions and 60 deletions

View file

@ -206,7 +206,7 @@ MAIL_DATA = {
"REPLYTO": "cof@ens.fr",
},
"rappels": {"FROM": "Le BdA <bda@ens.fr>", "REPLYTO": "Le BdA <bda@ens.fr>"},
"kfet": {
"rappel_negatif": {
"FROM": "La K-Fêt <chefs-k-fet@ens.fr>",
"REPLYTO": "La K-Fêt <chefs-k-fet@ens.fr>",
},

View file

@ -2,7 +2,6 @@ import re
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core.mail import EmailMessage
from django.core.validators import RegexValidator
from django.db import models, transaction
@ -270,32 +269,6 @@ class Account(models.Model):
def __init__(self, trigramme):
self.trigramme = trigramme
def send_creation_email(self):
"""
Envoie un mail à la création du trigramme.
"""
mail_data = settings.MAIL_DATA["kfet"]
email = EmailMessage(
subject="Création d'un trigramme",
body=loader.render_to_string(
"kfet/mails/creation_trigramme.txt",
context={
"account": self,
"site": Site.objects.get_current(),
"url_read": reverse("kfet.account.read", args=(self.trigramme)),
"url_update": reverse("kfet.account.update", args=(self.trigramme)),
"url_delete": reverse("kfet.account.delete", args=(self.trigramme))
},
),
from_email=mail_data["FROM"],
to=[self.email],
reply_to=[mail_data["REPLYTO"]],
)
# On envoie le mail
email.send()
def get_deleted_account():
return Account.objects.get(trigramme=KFET_DELETED_TRIGRAMME)
@ -325,7 +298,7 @@ class AccountNegative(models.Model):
"""
Envoie un mail de rappel signalant que la personne est en négatif.
"""
mail_data = settings.MAIL_DATA["kfet"]
mail_data = settings.MAIL_DATA["rappel_negatif"]
email = EmailMessage(
subject="Compte K-Psul négatif",
@ -348,6 +321,7 @@ class AccountNegative(models.Model):
# On enregistre le fait que l'envoi a bien eu lieu
self.last_rappel = timezone.now()
self.save()
return
class CheckoutQuerySet(models.QuerySet):

View file

@ -78,7 +78,7 @@ class KfetWebsocket {
listen() {
var that = this;
this.socket = new ReconnectingWebSocket(this.url, [], { minReconnectionDelay: 100 });
this.socket = new ReconnectingWebSocket(this.url);
this.socket.onmessage = function (e) {
var data = $.extend({}, that.default_msg, JSON.parse(e.data));

View file

@ -1,12 +0,0 @@
Salut {{ account.name }},
Ton compte K-Fêt a bien été créé le {{ account.created_at }} avec le trigramme {{ account.trigramme }}.
Tu peux désormais :
- Accéder à ton historique personnel des consommations : https://{{ site }}{{ url_read }}
- Modifier tes informations : https://{{ site }}{{ url_update }}
- Supprimer ton compte : https://{{ site }}{{ url_delete }}
En espérant te revoir bientôt,
--
L'équipe K-Fêt

View file

@ -243,7 +243,6 @@ def account_create(request):
account_form = AccountNoTriForm(request.POST, instance=account)
account_form.save()
messages.success(request, "Compte créé : %s" % account.trigramme)
account.send_creation_email()
return redirect("kfet.account.create")
except Account.UserHasAccount as e:
messages.error(

View file

@ -10,14 +10,14 @@ Le COF a reçu une demande de petit cours qui te correspond. Tu es en haut de la
¤ Lieu (si préféré) : {{ demande.lieu }}
{% if matieres|length > 1 %}¤ Matières :
{% for matiere in matieres %} ¤ {{ matiere }}
{% endfor %}{% else %}¤ Matière : {% for matiere in matieres %}{{ matiere }}
{% endfor %}{% endif %}
¤ Niveau : {{ demande.get_niveau_display }}
¤ Remarques diverses (désolé pour les balises HTML) : {{ demande.remarques }}
{% if matieres|length > 1 %}¤ Matières :
{% for matiere in matieres %} ¤ {{ matiere }}
{% endfor %}{% else %}¤ Matière : {% for matiere in matieres %}{{ matiere }}
{% endfor %}{% endif %}
Voilà, cette personne te contactera peut-être sous peu, tu pourras voir les détails directement avec elle (prix, modalités, ...). Pour indication, 30 Euro/h semble être la moyenne.
Si tu te rends compte qu'en fait tu ne peux pas/plus donner de cours en ce moment, ça serait cool que tu décoches la case "Recevoir des propositions de petits cours" sur GestioCOF. Ensuite dès que tu voudras réapparaître tu pourras recocher la case et tu seras à nouveau sur la liste.

View file

@ -1,12 +1,29 @@
{
pkgs ? import <nixpkgs> { },
...
}:
{ pkgs ? import <nixpkgs> { }, ... }:
let
python = pkgs.python39;
python = pkgs.python38;
django-types = python.pkgs.buildPythonPackage rec {
pname = "django-types";
version = "0.17.0";
format = "pyproject";
src = pkgs.fetchPypi {
inherit pname version;
hash = "sha256-wcQqt4h2xXxyg0LVqwYHJas3H8jcg7uFuuC+BoRqrXA=";
};
nativeBuildInputs = with python.pkgs; [ poetry-core ];
# setup.cfg tries to pull in nonexistent LICENSE.txt file
# postPatch = "rm setup.cfg";
# propagatedBuildInputs = [ django typing-extensions ];
};
in
pkgs.mkShell {
shellHook = ''
export DJANGO_SETTINGS_MODULE=gestioasso.settings.local
@ -17,14 +34,11 @@ pkgs.mkShell {
pip install -r requirements-devel.txt | grep -v 'Requirement already satisfied:'
'';
packages =
[ python ]
++ (with python.pkgs; [
django-types
pip
virtualenv
python-ldap
]);
packages = [ python django-types ] ++ (with python.pkgs; [
pip
virtualenv
python-ldap
]);
allowSubstitutes = false;
}