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