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