Remove bank, Kfet and add BDA and BDS (need to fix activity, permission and registration)

This commit is contained in:
Jean-Baptiste Doderlein 2022-08-17 21:29:39 +00:00
parent 3a3e3be64c
commit 838bd2bb23
43 changed files with 128 additions and 639 deletions

View file

@ -20,9 +20,9 @@ from .models import Activity, Guest
class ActivityForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# By default, the Kfet club is attended
self.fields["attendees_club"].initial = Club.objects.get(name="Kfet")
self.fields["attendees_club"].widget.attrs["placeholder"] = "Kfet"
# By default, the BDE club is attended
self.fields["attendees_club"].initial = Club.objects.get(name="BDE")
self.fields["attendees_club"].widget.attrs["placeholder"] = "BDE"
clubs = list(Club.objects.filter(PermissionBackend
.filter_queryset(get_current_request(), Club, "view")).all())
shuffle(clubs)

View file

@ -1,4 +1,4 @@
# Generated by Django 2.2.16 on 2020-09-04 21:41
# Generated by Django 2.2.28 on 2022-08-17 20:53
from django.db import migrations, models
import django.utils.timezone

View file

@ -1,4 +1,4 @@
# Generated by Django 2.2.16 on 2020-09-04 21:41
# Generated by Django 2.2.28 on 2022-08-17 20:53
from django.conf import settings
from django.db import migrations, models
@ -10,10 +10,10 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
('activity', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('member', '0001_initial'),
('activity', '0001_initial'),
('note', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [

View file

@ -73,7 +73,7 @@ class Activity(models.Model):
max_length=255,
blank=True,
default="",
help_text=_("Place where the activity is organized, eg. Kfet."),
help_text=_("Place where the activity is organized, eg. BDE."),
)
activity_type = models.ForeignKey(
@ -102,7 +102,7 @@ class Activity(models.Model):
on_delete=models.PROTECT,
related_name='+',
verbose_name=_('attendees club'),
help_text=_("Club that is authorized to join the activity. Mostly the Kfet club."),
help_text=_("Club that is authorized to join the activity."),
)
date_start = models.DateTimeField(

View file

@ -150,8 +150,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
"source": credit_id,
"destination": target.attr('data-inviter'),
"last_name": last_name,
"first_name": first_name,
"bank": ""
"first_name": first_name
}).done(function () {
makeTransaction();
reset();

View file

@ -38,8 +38,8 @@ class TestActivities(TestCase):
location="Earth",
activity_type=ActivityType.objects.get(name="Activit\u00e9 gratuite ouverte"),
creater=self.user,
organizer=Club.objects.get(name="Kfet"),
attendees_club=Club.objects.get(name="Kfet"),
organizer=Club.objects.get(name="BDE"),
attendees_club=Club.objects.get(name="BDE"),
date_start=timezone.now(),
date_end=timezone.now() + timedelta(days=2),
valid=True,
@ -72,8 +72,8 @@ class TestActivities(TestCase):
location="Earth",
activity_type=ActivityType.objects.get(name="Soir\u00e9e").id,
creater=self.user.id,
organizer=Club.objects.get(name="Kfet").id,
attendees_club=Club.objects.get(name="Kfet").id,
organizer=Club.objects.get(name="BDE").id,
attendees_club=Club.objects.get(name="BDE").id,
date_start="{:%Y-%m-%d %H:%M}".format(timezone.now()),
date_end="{:%Y-%m-%d %H:%M}".format(timezone.now() + timedelta(days=2)),
valid=True,
@ -102,8 +102,8 @@ class TestActivities(TestCase):
location="Earth",
activity_type=ActivityType.objects.get(name="Soir\u00e9e").id,
creater=self.user.id,
organizer=Club.objects.get(name="Kfet").id,
attendees_club=Club.objects.get(name="Kfet").id,
organizer=Club.objects.get(name="BDE").id,
attendees_club=Club.objects.get(name="BDE").id,
date_start="{:%Y-%m-%d %H:%M}".format(timezone.now()),
date_end="{:%Y-%m-%d %H:%M}".format(timezone.now() + timedelta(days=2)),
valid=True,
@ -188,8 +188,8 @@ class TestActivityAPI(TestAPI):
location="Earth",
activity_type=ActivityType.objects.get(name="Activit\u00e9 gratuite ouverte"),
creater=self.user,
organizer=Club.objects.get(name="Kfet"),
attendees_club=Club.objects.get(name="Kfet"),
organizer=Club.objects.get(name="BDE"),
attendees_club=Club.objects.get(name="BDE"),
date_start=timezone.now(),
date_end=timezone.now() + timedelta(days=2),
valid=True,

View file

@ -340,7 +340,7 @@ UID:{md5((activity.name + "$" + str(activity.id) + str(activity.date_start)).enc
SUMMARY;CHARSET=UTF-8:{self.multilines(activity.name, 75, 22)}
DTSTART;TZID=Europe/Berlin:{"{:%Y%m%dT%H%M%S}".format(activity.date_start)}
DTEND;TZID=Europe/Berlin:{"{:%Y%m%dT%H%M%S}".format(activity.date_end)}
LOCATION:{self.multilines(activity.location, 75, 9) if activity.location else "Kfet"}
LOCATION:{self.multilines(activity.location, 75, 9) if activity.location else "BDA"}
DESCRIPTION;CHARSET=UTF-8:""" + self.multilines(activity.description.replace("\n", "\\n"), 75, 26) + """
-- {activity.organizer.name}
END:VEVENT