...
 
Commits (6)
...@@ -68,7 +68,7 @@ class SocietyIndexView(ListView): ...@@ -68,7 +68,7 @@ class SocietyIndexView(ListView):
return localize_attr_name('name') return localize_attr_name('name')
class SocietyDetailView(DetailView): class SocietyDetailView(_MemberGroupDetailView):
""" """
View that renders the page of one selected society View that renders the page of one selected society
""" """
......
...@@ -23,7 +23,7 @@ urlpatterns = [ ...@@ -23,7 +23,7 @@ urlpatterns = [
name="submit-summary"), name="submit-summary"),
path('', CourseDetailView.as_view(), name="course"), path('', CourseDetailView.as_view(), name="course"),
])), ])),
path('exam/<int:pk>/', ExamDetailView.as_view, name="exam"), path('exam/<int:pk>/', ExamDetailView.as_view(), name="exam"),
path('summary/(<int:pk>/', SummaryDetailView.as_view(), path('summary/(<int:pk>/', SummaryDetailView.as_view(),
name="summary"), name="summary"),
path('exam/upload/', ExamCreateView.as_view(), path('exam/upload/', ExamCreateView.as_view(),
......
...@@ -38,7 +38,8 @@ class ListView extends FullCalendar.View { ...@@ -38,7 +38,8 @@ class ListView extends FullCalendar.View {
month: 'long', month: 'long',
weekday: 'long', weekday: 'long',
year: 'numeric', year: 'numeric',
hour12: false, timeZone: 'UTC',
hour12: locale !== 'nl',
}); });
const eventCard = document.createElement('div'); const eventCard = document.createElement('div');
......
...@@ -8,7 +8,6 @@ from django.template import loader ...@@ -8,7 +8,6 @@ from django.template import loader
from django.template.defaultfilters import floatformat from django.template.defaultfilters import floatformat
from django.urls import reverse from django.urls import reverse
from django.utils import timezone, translation from django.utils import timezone, translation
from django.utils.datetime_safe import datetime
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from members.models import Member, Membership from members.models import Member, Membership
...@@ -124,7 +123,7 @@ def send_expiration_announcement(dry_run=False): ...@@ -124,7 +123,7 @@ def send_expiration_announcement(dry_run=False):
:param dry_run: does not really send emails if True :param dry_run: does not really send emails if True
""" """
expiry_date = datetime.now() + timedelta(days=31) expiry_date = timezone.now() + timedelta(days=31)
members = (Member.current_members members = (Member.current_members
.filter(membership__until__lte=expiry_date) .filter(membership__until__lte=expiry_date)
.exclude(membership__until__isnull=True) .exclude(membership__until__isnull=True)
......
...@@ -24,14 +24,12 @@ def send_vacancy_expiration_notifications(dry_run=False): ...@@ -24,14 +24,12 @@ def send_vacancy_expiration_notifications(dry_run=False):
'\n\nKind regards,\nThe website' '\n\nKind regards,\nThe website'
.format(exp_vacancy.title, .format(exp_vacancy.title,
exp_vacancy.get_company_name())) exp_vacancy.get_company_name()))
recipient = settings.PARTNER_EMAIL
if not dry_run: if not dry_run:
# Send Mail # Send Mail
EmailMessage( EmailMessage(
subject, subject,
text_message, text_message,
to=[recipient] to=[settings.PARTNER_NOTIFICATION_ADDRESS]
).send() ).send()
# Save that mail has been sent into database # Save that mail has been sent into database
......
...@@ -228,9 +228,10 @@ class RenewalFormView(FormView): ...@@ -228,9 +228,10 @@ class RenewalFormView(FormView):
request.POST['length'] = Entry.MEMBERSHIP_YEAR request.POST['length'] = Entry.MEMBERSHIP_YEAR
request.POST['member'] = request.member.pk request.POST['member'] = request.member.pk
request.POST['remarks'] = '' request.POST['remarks'] = ''
request.POST['no_references'] = False request.POST['no_references'] = True
if request.POST['membership_type'] == Membership.BENEFACTOR: if request.POST['membership_type'] == Membership.BENEFACTOR:
request.POST['no_references'] = False
if Membership.objects.filter(user=request.member, if Membership.objects.filter(user=request.member,
type=Membership.MEMBER).exists(): type=Membership.MEMBER).exists():
request.POST['remarks'] = 'Was a Thalia member in the past.' request.POST['remarks'] = 'Was a Thalia member in the past.'
......
...@@ -66,24 +66,24 @@ def _extract_date(param): ...@@ -66,24 +66,24 @@ def _extract_date(param):
def extract_date_range(request, allow_empty=False): def extract_date_range(request, allow_empty=False):
"""Extract a date range from an arbitrary string""" """Extract a date range from an arbitrary string"""
default_value = '' default_value = None
if allow_empty:
default_value = None
start = request.query_params.get('start', default_value) start = request.query_params.get('start', default_value)
start = dateparse.parse_datetime(start) if start or not allow_empty:
if not timezone.is_aware(start): try:
start = timezone.make_aware(start) start = dateparse.parse_datetime(start)
if not timezone.is_aware(start):
if not start and not allow_empty: start = timezone.make_aware(start)
raise ParseError(detail='start query parameter invalid') except (ValueError, AttributeError, TypeError) as e:
raise ParseError(detail='start query parameter invalid') from e
end = dateparse.parse_datetime(
request.query_params.get('end', default_value)) end = request.query_params.get('end', default_value)
if not timezone.is_aware(end): if end or not allow_empty:
end = timezone.make_aware(end) try:
end = dateparse.parse_datetime(end)
if not end and not allow_empty: if not timezone.is_aware(end):
raise ParseError(detail='end query parameter invalid') end = timezone.make_aware(end)
except (ValueError, AttributeError, TypeError) as e:
raise ParseError(detail='end query parameter invalid') from e
return start, end return start, end