Add link to full bulletin
This commit is contained in:
parent
a681b05473
commit
ee1aa8f200
@ -60,11 +60,16 @@ def bulletin_list(request):
|
||||
|
||||
@login_required
|
||||
def bulletin_preview(request):
|
||||
if request.method == 'POST' or request.GET.get('full', False) is not False:
|
||||
if request.method == 'POST':
|
||||
group_ids = [int(k[6:]) for k, v in request.POST.items() if k.startswith('group_') and v]
|
||||
groups = [group for group in models.Group.objects.all() if group.id in group_ids]
|
||||
dt = datetime.datetime.strptime(request.POST['date'], '%Y-%m-%d')
|
||||
else:
|
||||
groups = models.Group.objects.all()
|
||||
dt = timezone.now() - datetime.timedelta(days=6)
|
||||
|
||||
calbegin, calend, bulbegin, bulend = utils.bulletin_dates(datetime.datetime.strptime(request.POST['date'], '%Y-%m-%d'))
|
||||
calbegin, calend, bulbegin, bulend = utils.bulletin_dates(dt)
|
||||
return render(request, 'sspromotions/email/bulletin.html', utils.bulletin_args(None, groups, utils.get_calendar_events(calbegin, calend), bulbegin, bulend))
|
||||
else:
|
||||
date = timezone.now().date()
|
||||
|
Loading…
Reference in New Issue
Block a user