Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Showing
with 165 additions and 101 deletions
......@@ -16,72 +16,72 @@ Subpackages
Submodules
----------
registrations\.admin module
---------------------------
registrations.admin module
--------------------------
.. automodule:: registrations.admin
:members:
:undoc-members:
:show-inheritance:
registrations\.apps module
--------------------------
registrations.apps module
-------------------------
.. automodule:: registrations.apps
:members:
:undoc-members:
:show-inheritance:
registrations\.emails module
----------------------------
registrations.emails module
---------------------------
.. automodule:: registrations.emails
:members:
:undoc-members:
:show-inheritance:
registrations\.forms module
---------------------------
registrations.forms module
--------------------------
.. automodule:: registrations.forms
:members:
:undoc-members:
:show-inheritance:
registrations\.models module
----------------------------
registrations.models module
---------------------------
.. automodule:: registrations.models
:members:
:undoc-members:
:show-inheritance:
registrations\.services module
------------------------------
registrations.services module
-----------------------------
.. automodule:: registrations.services
:members:
:undoc-members:
:show-inheritance:
registrations\.signals module
-----------------------------
registrations.signals module
----------------------------
.. automodule:: registrations.signals
:members:
:undoc-members:
:show-inheritance:
registrations\.urls module
--------------------------
registrations.urls module
-------------------------
.. automodule:: registrations.urls
:members:
:undoc-members:
:show-inheritance:
registrations\.views module
---------------------------
registrations.views module
--------------------------
.. automodule:: registrations.views
:members:
......
registrations\.templatetags package
===================================
registrations.templatetags package
==================================
.. automodule:: registrations.templatetags
:members:
......@@ -9,8 +9,8 @@ registrations\.templatetags package
Submodules
----------
registrations\.templatetags\.form\_field module
-----------------------------------------------
registrations.templatetags.form\_field module
---------------------------------------------
.. automodule:: registrations.templatetags.form_field
:members:
......
recommonmark
sphinx==1.6.7
sphinx==1.7.6
......@@ -9,48 +9,48 @@ thabloid package
Submodules
----------
thabloid\.admin module
----------------------
thabloid.admin module
---------------------
.. automodule:: thabloid.admin
:members:
:undoc-members:
:show-inheritance:
thabloid\.apps module
---------------------
thabloid.apps module
--------------------
.. automodule:: thabloid.apps
:members:
:undoc-members:
:show-inheritance:
thabloid\.models module
-----------------------
thabloid.models module
----------------------
.. automodule:: thabloid.models
:members:
:undoc-members:
:show-inheritance:
thabloid\.sitemaps module
-------------------------
thabloid.sitemaps module
------------------------
.. automodule:: thabloid.sitemaps
:members:
:undoc-members:
:show-inheritance:
thabloid\.urls module
---------------------
thabloid.urls module
--------------------
.. automodule:: thabloid.urls
:members:
:undoc-members:
:show-inheritance:
thabloid\.views module
----------------------
thabloid.views module
---------------------
.. automodule:: thabloid.views
:members:
......
thaliawebsite\.api package
==========================
thaliawebsite.api package
=========================
.. automodule:: thaliawebsite.api
:members:
......@@ -9,8 +9,8 @@ thaliawebsite\.api package
Submodules
----------
thaliawebsite\.api\.services module
-----------------------------------
thaliawebsite.api.services module
---------------------------------
.. automodule:: thaliawebsite.api.services
:members:
......
......@@ -18,72 +18,72 @@ Subpackages
Submodules
----------
thaliawebsite\.admin module
---------------------------
thaliawebsite.admin module
--------------------------
.. automodule:: thaliawebsite.admin
:members:
:undoc-members:
:show-inheritance:
thaliawebsite\.celery module
----------------------------
thaliawebsite.celery module
---------------------------
.. automodule:: thaliawebsite.celery
:members:
:undoc-members:
:show-inheritance:
thaliawebsite\.context\_processors module
-----------------------------------------
thaliawebsite.context\_processors module
----------------------------------------
.. automodule:: thaliawebsite.context_processors
:members:
:undoc-members:
:show-inheritance:
thaliawebsite\.forms module
---------------------------
thaliawebsite.forms module
--------------------------
.. automodule:: thaliawebsite.forms
:members:
:undoc-members:
:show-inheritance:
thaliawebsite\.menus module
---------------------------
thaliawebsite.menus module
--------------------------
.. automodule:: thaliawebsite.menus
:members:
:undoc-members:
:show-inheritance:
thaliawebsite\.sitemaps module
------------------------------
thaliawebsite.sitemaps module
-----------------------------
.. automodule:: thaliawebsite.sitemaps
:members:
:undoc-members:
:show-inheritance:
thaliawebsite\.urls module
--------------------------
thaliawebsite.urls module
-------------------------
.. automodule:: thaliawebsite.urls
:members:
:undoc-members:
:show-inheritance:
thaliawebsite\.views module
---------------------------
thaliawebsite.views module
--------------------------
.. automodule:: thaliawebsite.views
:members:
:undoc-members:
:show-inheritance:
thaliawebsite\.wsgi module
--------------------------
thaliawebsite.wsgi module
-------------------------
.. automodule:: thaliawebsite.wsgi
:members:
......
thaliawebsite\.settings package
===============================
thaliawebsite.settings package
==============================
.. automodule:: thaliawebsite.settings
:members:
......@@ -9,24 +9,24 @@ thaliawebsite\.settings package
Submodules
----------
thaliawebsite\.settings\.production module
------------------------------------------
thaliawebsite.settings.production module
----------------------------------------
.. automodule:: thaliawebsite.settings.production
:members:
:undoc-members:
:show-inheritance:
thaliawebsite\.settings\.settings module
----------------------------------------
thaliawebsite.settings.settings module
--------------------------------------
.. automodule:: thaliawebsite.settings.settings
:members:
:undoc-members:
:show-inheritance:
thaliawebsite\.settings\.testing module
---------------------------------------
thaliawebsite.settings.testing module
-------------------------------------
.. automodule:: thaliawebsite.settings.testing
:members:
......
thaliawebsite\.templatetags package
===================================
thaliawebsite.templatetags package
==================================
.. automodule:: thaliawebsite.templatetags
:members:
......@@ -9,40 +9,40 @@ thaliawebsite\.templatetags package
Submodules
----------
thaliawebsite\.templatetags\.baseurl module
-------------------------------------------
thaliawebsite.templatetags.baseurl module
-----------------------------------------
.. automodule:: thaliawebsite.templatetags.baseurl
:members:
:undoc-members:
:show-inheritance:
thaliawebsite\.templatetags\.bleach\_tags module
------------------------------------------------
thaliawebsite.templatetags.bleach\_tags module
----------------------------------------------
.. automodule:: thaliawebsite.templatetags.bleach_tags
:members:
:undoc-members:
:show-inheritance:
thaliawebsite\.templatetags\.fieldtype module
---------------------------------------------
thaliawebsite.templatetags.fieldtype module
-------------------------------------------
.. automodule:: thaliawebsite.templatetags.fieldtype
:members:
:undoc-members:
:show-inheritance:
thaliawebsite\.templatetags\.menu module
----------------------------------------
thaliawebsite.templatetags.menu module
--------------------------------------
.. automodule:: thaliawebsite.templatetags.menu
:members:
:undoc-members:
:show-inheritance:
thaliawebsite\.templatetags\.pick\_header\_image module
-------------------------------------------------------
thaliawebsite.templatetags.pick\_header\_image module
-----------------------------------------------------
.. automodule:: thaliawebsite.templatetags.pick_header_image
:members:
......
utils\.management\.commands package
===================================
utils.management.commands package
=================================
.. automodule:: utils.management.commands
:members:
......@@ -9,8 +9,8 @@ utils\.management\.commands package
Submodules
----------
utils\.management\.commands\.createfixtures module
--------------------------------------------------
utils.management.commands.createfixtures module
-----------------------------------------------
.. automodule:: utils.management.commands.createfixtures
:members:
......
utils\.management package
=========================
utils.management package
========================
.. automodule:: utils.management
:members:
......
......@@ -17,56 +17,56 @@ Subpackages
Submodules
----------
utils\.exception\_filter module
-------------------------------
utils.exception\_filter module
------------------------------
.. automodule:: utils.exception_filter
:members:
:undoc-members:
:show-inheritance:
utils\.snippets module
----------------------
utils.snippets module
---------------------
.. automodule:: utils.snippets
:members:
:undoc-members:
:show-inheritance:
utils\.tasks module
-------------------
utils.tasks module
------------------
.. automodule:: utils.tasks
:members:
:undoc-members:
:show-inheritance:
utils\.threading module
-----------------------
utils.threading module
----------------------
.. automodule:: utils.threading
:members:
:undoc-members:
:show-inheritance:
utils\.translation module
-------------------------
utils.translation module
------------------------
.. automodule:: utils.translation
:members:
:undoc-members:
:show-inheritance:
utils\.validators module
------------------------
utils.validators module
-----------------------
.. automodule:: utils.validators
:members:
:undoc-members:
:show-inheritance:
utils\.views module
-------------------
utils.views module
------------------
.. automodule:: utils.views
:members:
......
utils\.templatetags package
===========================
utils.templatetags package
==========================
.. automodule:: utils.templatetags
:members:
......@@ -9,8 +9,8 @@ utils\.templatetags package
Submodules
----------
utils\.templatetags\.thumbnail module
-------------------------------------
utils.templatetags.thumbnail module
-----------------------------------
.. automodule:: utils.templatetags.thumbnail
:members:
......
......@@ -8,6 +8,7 @@ from .models import Board, Committee, CommitteeMembership
def committee_index(request):
"""
View that renders the committee overview page
:param request: the request object
:return: response containing the HTML
"""
......@@ -21,6 +22,7 @@ def committee_index(request):
def committee_detail(request, pk):
"""
View that renders the page of one selected committee
:param request: the request object
:param pk: pk of the selected committee
:return:
......@@ -49,6 +51,7 @@ def committee_detail(request, pk):
def board_index(request):
"""
View that renders the board overview page
:param request: the request object
:return: response containing the HTML
"""
......@@ -66,6 +69,7 @@ def board_index(request):
def board_detail(request, since, until=None):
"""
View that renders the board for a specific lecture year
:param request: the request object
:param since: xxxx in xxxx-yyyy of the lecture year
:param until: yyyy in xxxx-yyyy of the lecture year
......
......@@ -16,6 +16,7 @@ from utils.snippets import datetime_to_lectureyear
def index(request):
"""
View that renders the documents index page
:param request: the request object
:return: HttpResponse 200 containing the page HTML
"""
......@@ -55,6 +56,7 @@ def get_document(request, pk):
"""
View that allows you to download a specific document based on it's and your
permissions settings
:param request: the request object
:param pk: primary key of the document
:return: either a 302 redirect to the login page or a 200 with the document
......
......@@ -18,6 +18,7 @@ from .models import Category, Course, Exam, Summary
def courses(request):
"""
Renders an overview of the courses
:param request: the request object
:return: HttpResponse 200 containing the HTML as body
"""
......@@ -31,6 +32,7 @@ def courses(request):
def course(request, id):
"""
Renders the detail page of one specific course
:param request: the request object
:param id: the primary key of the selected course
:return: HttpResponse 200 containing the HTML as body
......@@ -65,6 +67,7 @@ def course(request, id):
def exam(request, id):
"""
Fetches and outputs the specified exam
:param request: the request object
:param id: the id of the exam
:return: 302 if not authenticated else 200 with the file as body
......@@ -85,6 +88,7 @@ def exam(request, id):
def summary(request, id):
"""
Fetches and outputs the specified summary
:param request: the request object
:param id: the id of the summary
:return: 302 if not authenticated else 200 with the file as body
......@@ -104,6 +108,7 @@ def summary(request, id):
def submit_exam(request, id=None):
"""
Renders the form to submit a new exam
:param request: the request object
:param id: the course id (optional)
:return: 302 if not authenticated else 200 with the form HTML as body
......@@ -135,6 +140,7 @@ def submit_exam(request, id=None):
def submit_summary(request, id=None):
"""
Renders the form to submit a new summary
:param request: the request object
:param id: the course id (optional)
:return: 302 if not authenticated else 200 with the form HTML as body
......@@ -169,6 +175,7 @@ def books(request):
"""
Renders a page with information about book sale
Only available to members and to-be members
:param request: the request object
:return: 403 if no active membership else 200 with the page HTML as body
"""
......
......@@ -21,6 +21,7 @@ from .models import Event, Registration
def details(request, event_id):
"""
Renders an overview of registration for the specified event
:param request: the request object
:param event_id: the primary key of the event
:return: HttpResponse 200 with the page HTML
......@@ -39,6 +40,7 @@ def details(request, event_id):
def change_registration(request, event_id, action=None):
"""
JSON call to change the status of a registration
:param request: the request object
:param event_id: the primary key of the event
:param action: specifies what should be changed
......@@ -72,6 +74,7 @@ def change_registration(request, event_id, action=None):
def export(request, event_id):
"""
Export the registration of a specified event
:param request: the request object
:param event_id: the primary key of the event
:return: A CSV containing all registrations for the event
......@@ -162,6 +165,7 @@ def export_email(request, event_id):
"""
Renders a page that outputs all email addresses of registered members
for an event
:param request: the request object
:param event_id: the primary key of the event
:return: HttpResponse 200 with the HTML of the page
......@@ -183,6 +187,7 @@ def export_email(request, event_id):
def all_present(request, event_id):
"""
Mark all registrations of an event as present
:param request: the request object
:param event_id: the primary key of the event
:return: HttpResponse 302 to the event admin page
......
......@@ -94,6 +94,7 @@ class EventViewset(viewsets.ReadOnlyModelViewSet):
"""
Defines a custom route for the event's registrations,
can filter on registration status if the user is an organiser
:param request: the request object
:param pk: the primary key of the event
:return: the registrations of the event
......@@ -142,6 +143,7 @@ class EventViewset(viewsets.ReadOnlyModelViewSet):
Defines a custom route that outputs the correctly formatted
events information for CalendarJS, published events only
:param request: the request object
:return: response containing the data
"""
end, start = _extract_date_range(request)
......@@ -161,6 +163,7 @@ class EventViewset(viewsets.ReadOnlyModelViewSet):
"""
Defines a custom route that outputs the correctly formatted
events information for CalendarJS, unpublished events only
:param request: the request object
:return: response containing the data
"""
......
......@@ -13,6 +13,7 @@ def notify_first_waiting(request, event):
"""
Send an email to the first person on the waiting list
when someone cancels their registration
:param request: the request object
:param event: the event
"""
......@@ -55,6 +56,7 @@ def notify_organiser(event, registration):
"""
Send an email to the organiser of the event if
someone cancels their registration
:param event: the event
:param registration: the registration that was cancelled
"""
......
......@@ -11,6 +11,7 @@ from events.models import Registration, RegistrationInformationField
def is_user_registered(member, event):
"""
Returns if the user is registered for the specified event
:param member: the user
:param event: the event
:return: None if registration is not required or no member else True/False
......@@ -26,6 +27,7 @@ def is_user_registered(member, event):
def event_permissions(member, event):
"""
Returns a dictionary with the available event permissions of the user
:param member: the user
:param event: the event
:return: the permission dictionary
......@@ -78,6 +80,7 @@ def is_organiser(member, event):
def create_registration(member, event):
"""
Creates a new user registration for an event
:param member: the user
:param event: the event
:return: returns the registration if successful
......@@ -117,6 +120,7 @@ def create_registration(member, event):
def cancel_registration(request, member, event):
"""
Cancel a user registration for an event
:param request: the request object
:param member: the user
:param event: the event
......@@ -152,6 +156,7 @@ def cancel_registration(request, member, event):
def update_registration(member, event, field_values):
"""
Updates a user registration of an event
:param member: the user
:param event: the event
:param field_values: values for the information fields
......@@ -191,6 +196,7 @@ def update_registration(member, event, field_values):
def registration_fields(member, event):
"""
Returns information about the registration fields of a registration
:param member: the user
:param event: the event
:return: the fields
......
......@@ -12,6 +12,12 @@ from members.models import Member, Membership
def send_membership_announcement(dry_run=False):
"""
Sends an email to all members with a never ending membership
excluding honorary members
:param dry_run: does not really send emails if True
"""
members = (Member.current_members
.filter(membership__until__isnull=True)
.exclude(membership__type=Membership.HONORARY)
......@@ -47,6 +53,11 @@ def send_membership_announcement(dry_run=False):
def send_information_request(dry_run=False):
"""
Sends an email to all members to have them check their personal information
:param dry_run: does not really send emails if True
"""
members = Member.current_members.all()
with mail.get_connection() as connection:
......@@ -80,6 +91,12 @@ def send_information_request(dry_run=False):
def send_expiration_announcement(dry_run=False):
"""
Sends an email to all members whose membership will end in the next 31 days
to warn them about this
:param dry_run: does not really send emails if True
"""
expiry_date = datetime.now() + timedelta(days=31)
members = (Member.current_members
.filter(membership__until__lte=expiry_date)
......@@ -125,6 +142,13 @@ def send_expiration_announcement(dry_run=False):
def send_welcome_message(user, password, language):
"""
Sends an email to a new mail welcoming them
:param user: the new user
:param password: randomly generated password
:param language: selected language during registration
"""
with translation.override(language):
email_body = loader.render_to_string(
'members/email/welcome.txt',
......@@ -139,6 +163,12 @@ def send_welcome_message(user, password, language):
def send_email_change_confirmation_messages(change_request):
"""
Sends emails to the old and new email address of a member to
confirm the email change
:param change_request the email change request entered by the user
"""
member = change_request.member
with translation.override(member.profile.language):
mail.EmailMessage(
......@@ -179,6 +209,11 @@ def send_email_change_confirmation_messages(change_request):
def send_email_change_completion_message(change_request):
"""
Sends email to the member to confirm the email change
:param change_request the email change request entered by the user
"""
change_request.member.email_user(
'[THALIA] {}'.format(_('Your email address has been changed')),
loader.render_to_string(
......