1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-22 02:18:21 +02:00

Add department and promotion in Profile model

This commit is contained in:
Yohann D'ANELLO
2020-04-22 16:25:09 +02:00
parent a85a5bf8fe
commit c31fb0c13d
4 changed files with 72 additions and 1 deletions

View File

@ -526,6 +526,13 @@ class ClubAddMemberView(ProtectQuerysetMixin, LoginRequiredMixin, CreateView):
# Now, all is fine, the membership can be created.
if club.name == "BDE":
# When we renew the BDE membership, we update the profile section.
# We could automate that and remove the section field from the Profile model,
# but with this way users can customize their section as they want.
user.profile.section = user.profile.section_generated
user.profile.save()
# Credit note before the membership is created.
if credit_amount > 0:
if not last_name or not first_name or (not bank and credit_type.special_type == "Chèque"):