Skip to content
GitLab
Menu
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
...
@@ -16,6 +16,7 @@ website
partners
partners
photos
photos
pizzas
pizzas
registrations
thabloid
thabloid
thaliawebsite
thaliawebsite
utils
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
This module registers admin pages for the models
"""
"""
import
csv
import
datetime
import
datetime
from
django.contrib
import
admin
from
django.contrib
import
admin
...
@@ -10,7 +11,6 @@ from django.db.models import Q
...
@@ -10,7 +11,6 @@ from django.db.models import Q
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
django.utils
import
timezone
from
django.utils
import
timezone
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
import
csv
from
.
import
forms
,
models
from
.
import
forms
,
models
...
@@ -145,8 +145,6 @@ class MemberAdmin(UserAdmin):
...
@@ -145,8 +145,6 @@ class MemberAdmin(UserAdmin):
return
False
return
False
admin
.
site
.
register
(
models
.
BecomeAMemberDocument
)
# re-register User admin
# re-register User admin
admin
.
site
.
unregister
(
User
)
admin
.
site
.
unregister
(
User
)
admin
.
site
.
register
(
User
,
UserAdmin
)
admin
.
site
.
register
(
User
,
UserAdmin
)
website/members/emails.py
View file @
8fa186a6
...
@@ -107,3 +107,17 @@ def send_expiration_announcement(dry_run=False):
...
@@ -107,3 +107,17 @@ def send_expiration_announcement(dry_run=False):
{
'members'
:
members
}),
{
'members'
:
members
}),
connection
=
connection
,
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 @@
...
@@ -27,7 +27,7 @@
"username"
:
"testuser"
,
"username"
:
"testuser"
,
"first_name"
:
""
,
"first_name"
:
""
,
"last_name"
:
""
,
"last_name"
:
""
,
"email"
:
""
,
"email"
:
"
testuser@example.com
"
,
"is_staff"
:
true
,
"is_staff"
:
true
,
"is_active"
:
true
,
"is_active"
:
true
,
"date_joined"
:
"2016-07-07T12:00:21Z"
,
"date_joined"
:
"2016-07-07T12:00:21Z"
,
...
@@ -53,6 +53,24 @@
...
@@ -53,6 +53,24 @@
"user_permissions"
:
[]
"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"
,
"model"
:
"members.profile"
,
"pk"
:
1
,
"pk"
:
1
,
...
@@ -131,6 +149,32 @@
...
@@ -131,6 +149,32 @@
"bank_account"
:
""
"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"
,
"model"
:
"members.membership"
,
"pk"
:
1
,
"pk"
:
1
,
...
...
website/members/forms.py
View file @
8fa186a6
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
from
django
import
forms
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
UserChangeForm
as
BaseUserChangeForm
from
django.contrib.auth.forms
import
UserCreationForm
as
BaseUserCreationForm
from
django.contrib.auth.forms
import
UserCreationForm
as
BaseUserCreationForm
from
django.template
import
loader
from
django.contrib.auth.models
import
User
from
django.utils
import
translation
from
django.utils.translation
import
ugettext
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
from
.models
import
Profile
from
.models
import
Profile
from
members
import
emails
class
ProfileForm
(
forms
.
ModelForm
):
class
ProfileForm
(
forms
.
ModelForm
):
...
@@ -74,17 +72,7 @@ class UserCreationForm(BaseUserCreationForm):
...
@@ -74,17 +72,7 @@ class UserCreationForm(BaseUserCreationForm):
language
=
str
(
self
.
data
.
get
(
'profile-0-language'
,
'en'
))
language
=
str
(
self
.
data
.
get
(
'profile-0-language'
,
'en'
))
if
language
not
in
(
'nl'
,
'en'
):
if
language
not
in
(
'nl'
,
'en'
):
language
=
'en'
language
=
'en'
with
translation
.
override
(
language
):
emails
.
send_welcome_message
(
user
,
password
,
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
)
return
user
return
user
class
Meta
:
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 ""
...
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
msgstr ""
"Project-Id-Version: \n"
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \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"
"PO-Revision-Date: 2017-10-18 21:32+0200\n"
"Last-Translator: Sébastiaan Versteeg <se_bastiaan@outlook.com>\n"
"Last-Translator: Sébastiaan Versteeg <se_bastiaan@outlook.com>\n"
"Language-Team: \n"
"Language-Team: \n"
...
@@ -54,11 +54,11 @@ msgstr "Adres"
...
@@ -54,11 +54,11 @@ msgstr "Adres"
msgid "Address line 2"
msgid "Address line 2"
msgstr "Tweede adresregel"
msgstr "Tweede adresregel"
#: admin.py:113 models.py:20
2
#: admin.py:113 models.py:20
1
msgid "Postal code"
msgid "Postal code"
msgstr "Postcode"
msgstr "Postcode"
#: admin.py:113 models.py:20
8
#: admin.py:113 models.py:20
7
msgid "City"
msgid "City"
msgstr "Woonplaats"
msgstr "Woonplaats"
...
@@ -66,7 +66,7 @@ msgstr "Woonplaats"
...
@@ -66,7 +66,7 @@ msgstr "Woonplaats"
msgid "Download address label for selected users"
msgid "Download address label for selected users"
msgstr "Download adreslabels voor geselecteerde gebruikers"
msgstr "Download adreslabels voor geselecteerde gebruikers"
#: admin.py:131 models.py:16
5
#: admin.py:131 models.py:16
4
msgid "Student number"
msgid "Student number"
msgstr "Studentnummer"
msgstr "Studentnummer"
...
@@ -98,99 +98,99 @@ msgstr "Verlopen lidmaatschap"
...
@@ -98,99 +98,99 @@ msgstr "Verlopen lidmaatschap"
msgid "Membership expiration announcement sent"
msgid "Membership expiration announcement sent"
msgstr "Meldingen vervallen lidmaatschap verzonden"
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"
msgid "Please enter a bank account"
msgstr "Voer een bankrekening in"
msgstr "Voer een bankrekening in"
#: forms.py:5
3
#: forms.py:5
1
msgid "Send welcome email"
msgid "Send welcome email"
msgstr "Stuur welkomste-mails"
msgstr "Stuur welkomste-mails"
#: forms.py:5
4
#: forms.py:5
2
msgid "This email will include the generated password"
msgid "This email will include the generated password"
msgstr "Deze e-mail zal het gegenereerde wachtwoord bevatten"
msgstr "Deze e-mail zal het gegenereerde wachtwoord bevatten"
#: forms.py:86
#: models.py:109
msgid "Welcome to Study Association Thalia"
msgstr "Welkom bij Studievereniging Thalia"
#: models.py:110
msgid "Is this user currently active"
msgid "Is this user currently active"
msgstr "Is deze user op dit moment actief"
msgstr "Is deze user op dit moment actief"
#: models.py:14
4
#: models.py:14
3
msgid "Computing Science"
msgid "Computing Science"
msgstr "Informatica"
msgstr "Informatica"
#: models.py:14
5
#: models.py:14
4
msgid "Information Sciences"
msgid "Information Sciences"
msgstr "Informatiekunde"
msgstr "Informatiekunde"
#: models.py:15
9
templates/members/profile.html:40
#: models.py:15
8
templates/members/profile.html:40
msgid "Study programme"
msgid "Study programme"
msgstr "Studie"
msgstr "Studie"
#: models.py:16
9
#: models.py:16
8
msgid "Enter a valid student- or e/z/u-number."
msgid "Enter a valid student- or e/z/u-number."
msgstr "Voer een geldig student- of e/z/u-nummer in."
msgstr "Voer een geldig student- of e/z/u-nummer in."
#: models.py:17
5
#: models.py:17
4
msgid "Starting year"
msgid "Starting year"
msgstr "Startjaar"
msgstr "Startjaar"
#: models.py:17
6
#: models.py:17
5
msgid "The year this member started studying."
msgid "The year this member started studying."
msgstr "Het jaar waarop dit lid begon met studeren."
msgstr "Het jaar waarop dit lid begon met studeren."
#: models.py:18
7
#: models.py:18
6
msgid "Include the house number"
msgid "Include the house number"
msgstr "Inclusief huisnummer"
msgstr "Inclusief huisnummer"
#: models.py:18
9
#: models.py:18
8
msgid "Street and house number"
msgid "Street and house number"
msgstr "Straat en huisnummer"
msgstr "Straat en huisnummer"
#: models.py:19
5
#: models.py:19
4
msgid "Second address line"
msgid "Second address line"
msgstr "Tweede adresregel"
msgstr "Tweede adresregel"
#: models.py:21
4
#: models.py:21
3
msgid "Phone number"
msgid "Phone number"
msgstr "Telefoonnummer"
msgstr "Telefoonnummer"
#: models.py:21
5
#: models.py:21
4
msgid "Enter a phone number so Thalia may reach you"
msgid "Enter a phone number so Thalia may reach you"
msgstr "Voer een telefoonnummer in zodat Thalia je kan bereiken"
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"
msgid "Please enter a valid phone number"
msgstr "Voer svp een geldig telefoonnummer in"
msgstr "Voer svp een geldig telefoonnummer in"
#: models.py:22
8
#: models.py:22
7
msgid "Emergency contact name"
msgid "Emergency contact name"
msgstr "Contact voor noodgevallen"
msgstr "Contact voor noodgevallen"
#: models.py:22
9
#: models.py:22
8
msgid "Who should we contact in case of emergencies"
msgid "Who should we contact in case of emergencies"
msgstr "Wie Thalia moet bereiken in bij noodgevallen"
msgstr "Wie Thalia moet bereiken in bij noodgevallen"
#: models.py:23
6
#: models.py:23
5
msgid "Emergency contact phone number"
msgid "Emergency contact phone number"
msgstr "Telefoonnummer noodcontact"
msgstr "Telefoonnummer noodcontact"
#: models.py:23
7
#: models.py:23
6
msgid "The phone number for the emergency contact"
msgid "The phone number for the emergency contact"
msgstr "Het telefoonummer van de noodcontact"
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"
msgid "Birthday"
msgstr "Verjaardag"
msgstr "Verjaardag"
#: models.py:25
4
#: models.py:25
3
msgid "Display birthday"
msgid "Display birthday"
msgstr "Laat verjaardag zien"
msgstr "Laat verjaardag zien"
#: models.py:25
6
#: models.py:25
5
msgid ""
msgid ""
"Show your birthday to other members on your profile page and in the birthday "
"Show your birthday to other members on your profile page and in the birthday "
"calendar"
"calendar"
...
@@ -198,107 +198,107 @@ msgstr ""
...
@@ -198,107 +198,107 @@ msgstr ""
"Toon je verjaardag aan andere leden op je profielpagina en in de "
"Toon je verjaardag aan andere leden op je profielpagina en in de "
"verjaardagskalender"
"verjaardagskalender"
#: models.py:26
3
templates/members/profile.html:43
#: models.py:26
2
templates/members/profile.html:43
msgid "Website"
msgid "Website"
msgstr "Website"
msgstr "Website"
#: models.py:26
4
#: models.py:26
3
msgid "Website to display on your profile page"
msgid "Website to display on your profile page"
msgstr "Website om op je profiel te linken"
msgstr "Website om op je profiel te linken"
#: models.py:2
70
#: models.py:2
69
msgid "Profile text"
msgid "Profile text"
msgstr "Profieltekst"
msgstr "Profieltekst"
#: models.py:27
1
#: models.py:27
0
msgid "Text to display on your profile"
msgid "Text to display on your profile"
msgstr "Tekst om te laten zien op je profielpagina"
msgstr "Tekst om te laten zien op je profielpagina"
#: models.py:27
8
#: models.py:27
7
msgid "Initials"
msgid "Initials"
msgstr "Initialen"
msgstr "Initialen"
#: models.py:28
5
#: models.py:28
4
msgid "Nickname"
msgid "Nickname"
msgstr "Bijnaam"
msgstr "Bijnaam"
#: models.py:29
2
#: models.py:29
1
msgid "How to display name"
msgid "How to display name"
msgstr "Weergave naam"
msgstr "Weergave naam"
#: models.py:29
3
#: models.py:29
2
msgid "Show full name"
msgid "Show full name"
msgstr "Volledige naam"
msgstr "Volledige naam"
#: models.py:29
4
#: models.py:29
3
msgid "Show only nickname"
msgid "Show only nickname"
msgstr "Alleen initialen"
msgstr "Alleen initialen"
#: models.py:29
5
#: models.py:29
4
msgid "Show only first name"
msgid "Show only first name"
msgstr "Alleen voornaam"
msgstr "Alleen voornaam"
#: models.py:29
6
#: models.py:29
5
msgid "Show initials and last name"
msgid "Show initials and last name"
msgstr "Alleen initialen en achternaam"
msgstr "Alleen initialen en achternaam"
#: models.py:29
7
#: models.py:29
6
msgid "Show name like \"John 'nickname' Doe\""
msgid "Show name like \"John 'nickname' Doe\""
msgstr "Laat zien als \"John 'bijnaam' Doe\""
msgstr "Laat zien als \"John 'bijnaam' Doe\""
#: models.py:29
8
#: models.py:29
7
msgid "Show nickname and last name"
msgid "Show nickname and last name"
msgstr "Laat bijnaam en achternaam zien"
msgstr "Laat bijnaam en achternaam zien"
#: models.py:30
3
#: models.py:30
2
msgid "Photo"
msgid "Photo"
msgstr "Foto"
msgstr "Foto"
#: models.py:31
1
#: models.py:31
0
msgid "Which events can this member attend"
msgid "Which events can this member attend"
msgstr "Welke evenementen mag dit lid bijwonen"
msgstr "Welke evenementen mag dit lid bijwonen"
#: models.py:31
2
#: models.py:31
1
msgid "All events"
msgid "All events"
msgstr "Alle evenementen"
msgstr "Alle evenementen"
#: models.py:31
3
#: models.py:31
2
msgid "User may not attend events"
msgid "User may not attend events"
msgstr "Gebruiker mag niet naar evenementen"
msgstr "Gebruiker mag niet naar evenementen"
#: models.py:31
4
#: models.py:31
3
msgid "User may not attend drinks"
msgid "User may not attend drinks"
msgstr "Gebruiker mag niet naar borrels"
msgstr "Gebruiker mag niet naar borrels"
#: models.py:31
5