Commit 3e0c58b5 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Use right set in views.py

parent f0bc11a9
......@@ -68,7 +68,6 @@ class NewsletterContent(models.Model, metaclass=ModelTranslateMeta):
newsletter = models.ForeignKey(Newsletter, on_delete=models.CASCADE)
class Meta:
#abstract = True
order_with_respect_to = 'newsletter'
......
......@@ -33,8 +33,8 @@ def preview(request, pk, lang=None):
return render(request, 'newsletters/email.html', {
'newsletter': newsletter,
'agenda_events': newsletter.newsletterevent_set.all().order_by(
'start_datetime'),
'agenda_events': newsletter.newslettercontent_set.filter(
newsletteritem=None).order_by('start_datetime'),
'main_partner': main_partner,
'lang_code': lang_code
})
......@@ -79,8 +79,8 @@ def admin_send(request, pk):
context = Context({
'newsletter': newsletter,
'agenda_events': newsletter.newsletterevent_set.all().order_by(
'start_datetime'),
'agenda_events': newsletter.newslettercontent_set.filter(
newsletteritem=None).order_by('start_datetime'),
'main_partner': main_partner,
'lang_code': language[0],
'request': request
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment