...
 
Commits (5)
......@@ -19,6 +19,7 @@ website
pizzas
pushnotifications
registrations
singlepages
thabloid
thaliawebsite
utils
singlepages package
===================
.. automodule:: singlepages
:members:
:undoc-members:
:show-inheritance:
Submodules
----------
singlepages.apps module
-----------------------
.. automodule:: singlepages.apps
:members:
:undoc-members:
:show-inheritance:
singlepages.sitemaps module
---------------------------
.. automodule:: singlepages.sitemaps
:members:
:undoc-members:
:show-inheritance:
singlepages.urls module
-----------------------
.. automodule:: singlepages.urls
:members:
:undoc-members:
:show-inheritance:
singlepages.views module
------------------------
.. automodule:: singlepages.views
:members:
:undoc-members:
:show-inheritance:
"""The forms defined by the activemembers module"""
from django import forms
from django.contrib.auth.models import Permission
from django.utils.translation import ugettext_lazy as _
from activemembers.models import MemberGroupMembership
from members.models import Member
......@@ -10,7 +11,9 @@ class MemberGroupMembershipForm(forms.ModelForm):
"""Custom form for group memberships that orders the members"""
member = forms.ModelChoiceField(
queryset=Member.objects.order_by('first_name',
'last_name'))
'last_name'),
label=_('Member'),
)
class Meta:
model = MemberGroupMembership
......
......@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-01-15 16:04+0100\n"
"PO-Revision-Date: 2019-01-15 16:07+0100\n"
"POT-Creation-Date: 2019-10-09 20:36+0200\n"
"PO-Revision-Date: 2019-10-09 20:38+0200\n"
"Last-Translator: Thom Wiggers <thom@thomwiggers.nl>\n"
"Language-Team: \n"
"Language: nl\n"
......@@ -16,7 +16,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 2.2\n"
"X-Generator: Poedit 2.2.3\n"
#: admin.py models.py
msgid "group memberships"
......@@ -98,6 +98,10 @@ msgstr "Exporteer de geselecteerde lidmaatschappen"
msgid "Active members"
msgstr "Actieve leden"
#: forms.py models.py
msgid "Member"
msgstr "Lid"
#: models.py
msgid "Name"
msgstr "Naam"
......@@ -130,7 +134,7 @@ msgstr ""
"Dit moet alleen uitgevinkt worden als de commissie is opgeheven. De website "
"gaat er vanuit dat de commissies op de site op enig moment bestonden."
#: models.py
#: models.py templates/activemembers/membergroup_detail.html
msgid "contact email address"
msgstr "contact e-mailadres"
......@@ -189,10 +193,6 @@ msgstr "Toegang tot bestuurswiki"
msgid "A board already exists for those years"
msgstr "Er bestaat al een bestuur voor die jaren"
#: models.py
msgid "Member"
msgstr "Lid"
#: models.py
msgid "The date this member joined in this role"
msgstr "De datum waarop deze persoon lid werd in deze rol"
......@@ -231,10 +231,6 @@ msgstr "De begindatum kan niet voor de begindatum van de groep liggen"
msgid "Start date can't be after group end date"
msgstr "De begindatum kan niet na de einddatum van de groep liggen"
#: models.py
msgid "End date cannot be set for boards"
msgstr "Voor besturen kan geen einddatum worden opgegeven"
#: models.py
msgid "There already is a chair for this time period"
msgstr "Er is al een voorzitter voor deze periode"
......@@ -243,6 +239,11 @@ msgstr "Er is al een voorzitter voor deze periode"
msgid "This member is already in the group for this period"
msgstr "Deze persoon is al lid van deze groep in de aangegeven periode"
#: models.py
#, python-brace-format
msgid "{member} membership of {group} since {since}, until {until}"
msgstr "{member} lidmaatschap van {group} sinds {since}, tot {until}"
#: models.py
msgid "group membership"
msgstr "groepslidmaatschap"
......
......@@ -44,7 +44,7 @@
<div class="row mt-4">
{% for board in old_boards %}
<div class="col-4 col-md-3 my-3">
{% membergroup_card board %}
{% membergroup_card board LANGUAGE_CODE %}
</div>
{% endfor %}
</div>
......
......@@ -2,6 +2,7 @@
{% load i18n thumbnail static activemembers_cards alert %}
{% block title %}{% trans 'committees'|capfirst %} — {{ block.super }}{% endblock %}
{% block opengraph_title %}{% trans 'committees'|capfirst %} — {{ block.super }}{% endblock %}
{% get_current_language as LANGUAGE_CODE %}
{% block body %}
<section id="activemembers-committees" class="page-section">
......@@ -13,7 +14,7 @@
<div class="row mt-4">
{% for committee in committees %}
<div class="col-4 col-md-3 my-3">
{% membergroup_card committee %}
{% membergroup_card committee LANGUAGE_CODE %}
</div>
{% empty %}
{% trans 'There are no committees!' as no_committees %}
......
......@@ -2,6 +2,7 @@
{% load i18n thumbnail static activemembers_cards alert %}
{% block title %}{% trans 'societies'|capfirst %} — {{ block.super }}{% endblock %}
{% block opengraph_title %}{% trans 'societies'|capfirst %} — {{ block.super }}{% endblock %}
{% get_current_language as LANGUAGE_CODE %}
{% block body %}
<section id="activemembers-committees" class="page-section">
......@@ -23,7 +24,7 @@
<div class="row mt-4">
{% for society in societies %}
<div class="col-4 col-md-3 my-3">
{% membergroup_card society %}
{% membergroup_card society LANGUAGE_CODE %}
</div>
{% empty %}
{% trans 'There are no societies!' as no_societies %}
......
......@@ -11,8 +11,9 @@ register = template.Library()
@register.inclusion_tag('includes/grid_item.html')
def membergroup_card(group):
image_url = static('activemembers/images/placeholder_overview.png')
def membergroup_card(group, language):
image_url = static(f'activemembers/images/{language}/'
f'placeholder_overview.png')
if group.photo:
image_url = get_thumbnail_url(group.photo,
settings.THUMBNAIL_SIZES['medium'])
......
......@@ -5,7 +5,7 @@ from django.conf import settings
from django.db import models
from django.utils.translation import override
from django.utils.translation import ugettext_lazy as _
from firebase_admin import messaging
from firebase_admin import messaging, exceptions
from utils.translation import MultilingualField, ModelTranslateMeta
......@@ -174,15 +174,18 @@ class Message(models.Model, metaclass=ModelTranslateMeta):
messaging.send(message, dry_run=kwargs.get(
'dry_run', False))
success_total += 1
except messaging.ApiCallError as e:
except messaging.UnregisteredError:
failure_total += 1
Device.objects.filter(
registration_id=reg_id
).delete()
except exceptions.InvalidArgumentError:
failure_total += 1
Device.objects.filter(
registration_id=reg_id
).update(active=False)
except exceptions.FirebaseError:
failure_total += 1
d = Device.objects.filter(registration_id=reg_id)
if e.code == 'registration-token-not-registered':
d.delete()
elif (e.code == 'invalid-argument'
or e.code == 'invalid-recipient'
or e.code == 'invalid-registration-token'):
d.update(active=False)
self.sent = True
self.success = success_total
......
......@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-09-08 11:04+0200\n"
"PO-Revision-Date: 2019-09-08 11:04+0200\n"
"POT-Creation-Date: 2019-10-09 20:09+0200\n"
"PO-Revision-Date: 2019-10-09 20:09+0200\n"
"Last-Translator: Thom Wiggers <thom@thomwiggers.nl>\n"
"Language-Team: \n"
"Language: nl\n"
......@@ -116,6 +116,11 @@ msgstr "verjaardag"
msgid "I accept the <a href=\"{}\">privacy policy</a>."
msgstr "Ik accepteer het <a href=\"{}\">privacybeleid</a>."
#: forms.py
msgid "What lecture year did you start studying at Radboud University?"
msgstr ""
"Welk collegejaar ben je begonnen met studeren aan de Radboud Universiteit?"
#: forms.py
msgid "I am an employee of iCIS"
msgstr "Ik ben een medewerker van iCIS"
......
......@@ -32,7 +32,7 @@ class StaticViewSitemap(sitemaps.Sitemap):
>>> sitemap = StaticViewSitemap()
>>> sitemap.location('singlepages:become-active')
'/members/become-active'
'/members/become-active/'
:param obj: the item to reverse.
:type obj: str
......
......@@ -98,7 +98,7 @@ urlpatterns = [ # pylint: disable=invalid-name
path('', include('partners.urls')),
# App API
path('api/v1/', include([
path('token-auth', ObtainThaliaAuthToken.as_view()),
path('token-auth/', ObtainThaliaAuthToken.as_view()),
path('', include('activemembers.api.urls')),
path('', include('events.api.urls')),
path('', include('members.api.urls')),
......