Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
concrexit
Commits
8fa186a6
Commit
8fa186a6
authored
Nov 29, 2017
by
Tom van Bussel
Browse files
Merge branch 'feature/registrations' into 'master'
Registrations feature See merge request
!533
parents
3ef9f1fe
0d26a638
Changes
70
Hide whitespace changes
Inline
Side-by-side
docs/modules.rst
View file @
8fa186a6
...
...
@@ -16,6 +16,7 @@ website
partners
photos
pizzas
registrations
thabloid
thaliawebsite
utils
docs/registrations.rst
0 → 100644
View file @
8fa186a6
registrations package
=====================
.. automodule:: registrations
:members:
:undoc-members:
:show-inheritance:
Submodules
----------
registrations\.admin module
---------------------------
.. automodule:: registrations.admin
:members:
:undoc-members:
:show-inheritance:
registrations\.apps module
--------------------------
.. automodule:: registrations.apps
:members:
:undoc-members:
:show-inheritance:
registrations\.emails module
----------------------------
.. automodule:: registrations.emails
:members:
:undoc-members:
:show-inheritance:
registrations\.models module
----------------------------
.. automodule:: registrations.models
:members:
:undoc-members:
:show-inheritance:
registrations\.services module
------------------------------
.. automodule:: registrations.services
:members:
:undoc-members:
:show-inheritance:
registrations\.urls module
--------------------------
.. automodule:: registrations.urls
:members:
:undoc-members:
:show-inheritance:
website/members/admin.py
View file @
8fa186a6
"""
This module registers admin pages for the models
"""
import
csv
import
datetime
from
django.contrib
import
admin
...
...
@@ -10,7 +11,6 @@ from django.db.models import Q
from
django.http
import
HttpResponse
from
django.utils
import
timezone
from
django.utils.translation
import
ugettext_lazy
as
_
import
csv
from
.
import
forms
,
models
...
...
@@ -145,8 +145,6 @@ class MemberAdmin(UserAdmin):
return
False
admin
.
site
.
register
(
models
.
BecomeAMemberDocument
)
# re-register User admin
admin
.
site
.
unregister
(
User
)
admin
.
site
.
register
(
User
,
UserAdmin
)
website/members/emails.py
View file @
8fa186a6
...
...
@@ -107,3 +107,17 @@ def send_expiration_announcement(dry_run=False):
{
'members'
:
members
}),
connection
=
connection
,
)
def
send_welcome_message
(
user
,
password
,
language
):
with
translation
.
override
(
language
):
email_body
=
loader
.
render_to_string
(
'members/email/welcome.txt'
,
{
'full_name'
:
user
.
get_full_name
(),
'username'
:
user
.
username
,
'password'
:
password
})
user
.
email_user
(
_
(
'Welcome to Study Association Thalia'
),
email_body
)
website/members/fixtures/members.json
View file @
8fa186a6
...
...
@@ -27,7 +27,7 @@
"username"
:
"testuser"
,
"first_name"
:
""
,
"last_name"
:
""
,
"email"
:
""
,
"email"
:
"
testuser@example.com
"
,
"is_staff"
:
true
,
"is_active"
:
true
,
"date_joined"
:
"2016-07-07T12:00:21Z"
,
...
...
@@ -53,6 +53,24 @@
"user_permissions"
:
[]
}
},
{
"model"
:
"auth.user"
,
"pk"
:
4
,
"fields"
:
{
"password"
:
""
,
"last_login"
:
null
,
"is_superuser"
:
false
,
"username"
:
"testuser3"
,
"first_name"
:
""
,
"last_name"
:
""
,
"email"
:
""
,
"is_staff"
:
true
,
"is_active"
:
true
,
"date_joined"
:
"2016-07-07T14:50:26Z"
,
"groups"
:
[],
"user_permissions"
:
[]
}
},
{
"model"
:
"members.profile"
,
"pk"
:
1
,
...
...
@@ -131,6 +149,32 @@
"bank_account"
:
""
}
},
{
"model"
:
"members.profile"
,
"pk"
:
4
,
"fields"
:
{
"user"
:
4
,
"programme"
:
null
,
"student_number"
:
""
,
"address_street"
:
"testuser 3"
,
"address_street2"
:
""
,
"address_postal_code"
:
"6525 TE"
,
"address_city"
:
"Nijmegen"
,
"phone_number"
:
""
,
"emergency_contact"
:
""
,
"emergency_contact_phone_number"
:
""
,
"birthday"
:
"2016-07-07"
,
"show_birthday"
:
true
,
"website"
:
""
,
"profile_description"
:
""
,
"nickname"
:
""
,
"display_name_preference"
:
"full"
,
"language"
:
"nl"
,
"receive_optin"
:
true
,
"direct_debit_authorized"
:
false
,
"bank_account"
:
""
}
},
{
"model"
:
"members.membership"
,
"pk"
:
1
,
...
...
website/members/forms.py
View file @
8fa186a6
from
__future__
import
unicode_literals
from
django
import
forms
from
django.contrib.auth.models
import
User
from
django.contrib.auth.forms
import
UserChangeForm
as
BaseUserChangeForm
from
django.contrib.auth.forms
import
UserCreationForm
as
BaseUserCreationForm
from
django.template
import
loader
from
django.utils
import
translation
from
django.utils.translation
import
ugettext
from
django.contrib.auth.models
import
User
from
django.utils.translation
import
ugettext_lazy
as
_
from
.models
import
Profile
from
members
import
emails
class
ProfileForm
(
forms
.
ModelForm
):
...
...
@@ -74,17 +72,7 @@ class UserCreationForm(BaseUserCreationForm):
language
=
str
(
self
.
data
.
get
(
'profile-0-language'
,
'en'
))
if
language
not
in
(
'nl'
,
'en'
):
language
=
'en'
with
translation
.
override
(
language
):
email_body
=
loader
.
render_to_string
(
'members/email/welcome.txt'
,
{
'full_name'
:
user
.
get_full_name
(),
'username'
:
user
.
username
,
'password'
:
password
})
user
.
email_user
(
ugettext
(
'Welcome to Study Association Thalia'
),
email_body
)
emails
.
send_welcome_message
(
user
,
password
,
language
)
return
user
class
Meta
:
...
...
website/members/locale/nl/LC_MESSAGES/django.mo
View file @
8fa186a6
No preview for this file type
website/members/locale/nl/LC_MESSAGES/django.po
View file @
8fa186a6
...
...
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-1
0-18 21:31
+0
2
00\n"
"POT-Creation-Date: 2017-1
1-22 15:49
+0
1
00\n"
"PO-Revision-Date: 2017-10-18 21:32+0200\n"
"Last-Translator: Sébastiaan Versteeg <se_bastiaan@outlook.com>\n"
"Language-Team: \n"
...
...
@@ -54,11 +54,11 @@ msgstr "Adres"
msgid "Address line 2"
msgstr "Tweede adresregel"
#: admin.py:113 models.py:20
2
#: admin.py:113 models.py:20
1
msgid "Postal code"
msgstr "Postcode"
#: admin.py:113 models.py:20
8
#: admin.py:113 models.py:20
7
msgid "City"
msgstr "Woonplaats"
...
...
@@ -66,7 +66,7 @@ msgstr "Woonplaats"
msgid "Download address label for selected users"
msgstr "Download adreslabels voor geselecteerde gebruikers"
#: admin.py:131 models.py:16
5
#: admin.py:131 models.py:16
4
msgid "Student number"
msgstr "Studentnummer"
...
...
@@ -98,99 +98,99 @@ msgstr "Verlopen lidmaatschap"
msgid "Membership expiration announcement sent"
msgstr "Meldingen vervallen lidmaatschap verzonden"
#: forms.py:33
#: emails.py:122
msgid "Welcome to Study Association Thalia"
msgstr "Welkom bij Studievereniging Thalia"
#: forms.py:31
msgid "Please enter a bank account"
msgstr "Voer een bankrekening in"
#: forms.py:5
3
#: forms.py:5
1
msgid "Send welcome email"
msgstr "Stuur welkomste-mails"
#: forms.py:5
4
#: forms.py:5
2
msgid "This email will include the generated password"
msgstr "Deze e-mail zal het gegenereerde wachtwoord bevatten"
#: forms.py:86
msgid "Welcome to Study Association Thalia"
msgstr "Welkom bij Studievereniging Thalia"
#: models.py:110
#: models.py:109
msgid "Is this user currently active"
msgstr "Is deze user op dit moment actief"
#: models.py:14
4
#: models.py:14
3
msgid "Computing Science"
msgstr "Informatica"
#: models.py:14
5
#: models.py:14
4
msgid "Information Sciences"
msgstr "Informatiekunde"
#: models.py:15
9
templates/members/profile.html:40
#: models.py:15
8
templates/members/profile.html:40
msgid "Study programme"
msgstr "Studie"
#: models.py:16
9
#: models.py:16
8
msgid "Enter a valid student- or e/z/u-number."
msgstr "Voer een geldig student- of e/z/u-nummer in."
#: models.py:17
5
#: models.py:17
4
msgid "Starting year"
msgstr "Startjaar"
#: models.py:17
6
#: models.py:17
5
msgid "The year this member started studying."
msgstr "Het jaar waarop dit lid begon met studeren."
#: models.py:18
7
#: models.py:18
6
msgid "Include the house number"
msgstr "Inclusief huisnummer"
#: models.py:18
9
#: models.py:18
8
msgid "Street and house number"
msgstr "Straat en huisnummer"
#: models.py:19
5
#: models.py:19
4
msgid "Second address line"
msgstr "Tweede adresregel"
#: models.py:21
4
#: models.py:21
3
msgid "Phone number"
msgstr "Telefoonnummer"
#: models.py:21
5
#: models.py:21
4
msgid "Enter a phone number so Thalia may reach you"
msgstr "Voer een telefoonnummer in zodat Thalia je kan bereiken"
#: models.py:21
8
models.py:2
40
#: models.py:21
7
models.py:2
39
msgid "Please enter a valid phone number"
msgstr "Voer svp een geldig telefoonnummer in"
#: models.py:22
8
#: models.py:22
7
msgid "Emergency contact name"
msgstr "Contact voor noodgevallen"
#: models.py:22
9
#: models.py:22
8
msgid "Who should we contact in case of emergencies"
msgstr "Wie Thalia moet bereiken in bij noodgevallen"
#: models.py:23
6
#: models.py:23
5
msgid "Emergency contact phone number"
msgstr "Telefoonnummer noodcontact"
#: models.py:23
7
#: models.py:23
6
msgid "The phone number for the emergency contact"
msgstr "Het telefoonummer van de noodcontact"
#: models.py:24
9
templates/members/profile.html:47
#: models.py:24
8
templates/members/profile.html:47
msgid "Birthday"
msgstr "Verjaardag"
#: models.py:25
4
#: models.py:25
3
msgid "Display birthday"
msgstr "Laat verjaardag zien"
#: models.py:25
6
#: models.py:25
5
msgid ""
"Show your birthday to other members on your profile page and in the birthday "
"calendar"
...
...
@@ -198,107 +198,107 @@ msgstr ""
"Toon je verjaardag aan andere leden op je profielpagina en in de "
"verjaardagskalender"
#: models.py:26
3
templates/members/profile.html:43
#: models.py:26
2
templates/members/profile.html:43
msgid "Website"
msgstr "Website"
#: models.py:26
4
#: models.py:26
3
msgid "Website to display on your profile page"
msgstr "Website om op je profiel te linken"
#: models.py:2
70
#: models.py:2
69
msgid "Profile text"
msgstr "Profieltekst"
#: models.py:27
1
#: models.py:27
0
msgid "Text to display on your profile"
msgstr "Tekst om te laten zien op je profielpagina"
#: models.py:27
8
#: models.py:27
7
msgid "Initials"
msgstr "Initialen"
#: models.py:28
5
#: models.py:28
4
msgid "Nickname"
msgstr "Bijnaam"
#: models.py:29
2
#: models.py:29
1
msgid "How to display name"
msgstr "Weergave naam"
#: models.py:29
3
#: models.py:29
2
msgid "Show full name"
msgstr "Volledige naam"
#: models.py:29
4
#: models.py:29
3
msgid "Show only nickname"
msgstr "Alleen initialen"
#: models.py:29
5
#: models.py:29
4
msgid "Show only first name"
msgstr "Alleen voornaam"
#: models.py:29
6
#: models.py:29
5
msgid "Show initials and last name"
msgstr "Alleen initialen en achternaam"
#: models.py:29
7
#: models.py:29
6
msgid "Show name like \"John 'nickname' Doe\""
msgstr "Laat zien als \"John 'bijnaam' Doe\""
#: models.py:29
8
#: models.py:29
7
msgid "Show nickname and last name"
msgstr "Laat bijnaam en achternaam zien"
#: models.py:30
3
#: models.py:30
2
msgid "Photo"
msgstr "Foto"
#: models.py:31
1
#: models.py:31
0
msgid "Which events can this member attend"
msgstr "Welke evenementen mag dit lid bijwonen"
#: models.py:31
2
#: models.py:31
1
msgid "All events"
msgstr "Alle evenementen"
#: models.py:31
3
#: models.py:31
2
msgid "User may not attend events"
msgstr "Gebruiker mag niet naar evenementen"
#: models.py:31
4
#: models.py:31
3
msgid "User may not attend drinks"
msgstr "Gebruiker mag niet naar borrels"
#: models.py:31
5
#: models.py:31
4
msgid "User may not attend anything"
msgstr "Gebruiker mag nergens heen"
#: models.py:32
2
#: models.py:32
1
msgid "Preferred language"
msgstr "Voorkeurstaal"
#: models.py:32
3
#: models.py:32
2
msgid "Preferred language for e.g. newsletters"
msgstr "Voorkeurstaal voor b.v.b. nieuwsbrieven"
#: models.py:3
30
#: models.py:3
29
msgid "Receive opt-in mailings"
msgstr "Ontvang opt-in mailings"
#: models.py:33
1
#: models.py:33
0
msgid "Receive mailings about vacancies and events from Thalia's sponsors."
msgstr "Ontvang mailings over vacatures en evenementen van Thalia's sponsoren."
#: models.py:33
7
#: models.py:33
6
msgid "Receive newsletter"
msgstr "Ontvang nieuwsbrief"
#: models.py:33
8
#: models.py:33
7
msgid "Receive the Thalia Newsletter"
msgstr "Ontvang de Thalia nieuwsbrief"
#: models.py:34
5
#: models.py:34
4
msgid ""
"Yes, I want Thalia to take the membership fees from my bank account through "
"direct debit for each year."
...
...
@@ -306,69 +306,69 @@ msgstr ""
"Ja, ik wil dat Thalia verschuldigde lidmaatschapsgelden elk jaar van mijn "
"bankrekening afschrijft."
#: models.py:34
8
#: models.py:34
7
msgid "No, I will pay the contribution myself"
msgstr "Nee, ik zal de contributie zelf betalen"
#: models.py:34
9
#: models.py:34
8
msgid "Direct debit"
msgstr "Automatische afschijving"
#: models.py:3
50
#: models.py:3
49
msgid "Each year, have Thalia take the membership fees from my bank account"
msgstr ""
"Laat Thalia elk jaar het lidmaatschapsgeld van mijn bankrekening afschrijven"
#: models.py:35
6
#: models.py:35
5
msgid "Bank account"
msgstr "Bankrekening"
#: models.py:35
7
#: models.py:35
6
msgid "Bank account for direct debit"
msgstr "Bankrekening voor automatische afschrijving"
#: models.py:38
1
#: models.py:38
0
msgid "Display name"
msgstr "Weergavenaam"
#: models.py:4
1
0
#: models.py:40
9
msgid "You need to enter a nickname to use it as display name"
msgstr ""
"Je moet een bijnaam invoeren voordat je deze kunt gebruiken als weergavenaam"
#: models.py:44
4
#: models.py:44
7
msgid "Member"
msgstr "Lid"
#: models.py:44
5
#: models.py:44
8
msgid "Supporter"
msgstr "Begunstiger"
#: models.py:44
6
#: models.py:44
9
msgid "Honorary Member"
msgstr "Erelid"
#: models.py:45
1
templates/members/profile.html:37
#: models.py:45
4
templates/members/profile.html:37
msgid "Membership type"
msgstr "Lidtype"
#: models.py:4
59
#: models.py:4
62
msgid "User"
msgstr "Gebruiker"
#: models.py:46
3
#: models.py:46
6
msgid "Membership since"
msgstr "Lid sinds"
#: models.py:46
4
#: models.py:46
7
msgid "The date the member started holding this membership."
msgstr "De datum waarop het lid dit lidmaatschap is begonnen."
#: models.py:4
69
#: models.py:4
72
msgid "Membership until"
msgstr "Lid tot"
#: models.py:47
0
#: models.py:47
3
msgid "The date the member stops holding this membership."
msgstr "De datum waarop het lid dit lidmaatschap beëindigd."
...
...
@@ -401,28 +401,36 @@ msgstr "bekijk publieke profielpagina"
msgid "Take a look at your own profile."
msgstr "Bekijk je eigen profielpagina."
#: templates/members/account.html:27 templates/members/edit_profile.html:5
#: templates/members/account.html:25
msgid "manage membership"
msgstr "lidmaatschap beheren"
#: templates/members/account.html:26
msgid "Get information about your membership or renew it."
msgstr "Bekijk je lidmaatschap of vernieuw deze indien nodig."
#: templates/members/account.html:32 templates/members/edit_profile.html:5
#: templates/members/edit_profile.html:6 templates/members/edit_profile.html:9
msgid "edit profile"
msgstr "profiel bewerken"
#: templates/members/account.html:
28
#: templates/members/account.html:
33
msgid "Edit your profile and avatar."
msgstr "Bewerk je profiel en profielafbeelding."
#: templates/members/account.html:3
4
#: templates/members/account.html:3
9
msgid "change password"
msgstr "wachtwoord wijzigen"
#: templates/members/account.html:
35
#: templates/members/account.html:
40
msgid "Change your accounts' password."
msgstr "Wijzig het wachtwoord van je account."
#: templates/members/account.html:4
1
#: templates/members/account.html:4
6
msgid "logout"
msgstr "uitloggen"
#: templates/members/account.html:4
2
#: templates/members/account.html:4
7
msgid "Leave the restricted area of the website."