+ if csv:
+ return http.HttpResponse(
+ '\n'.join((
+ ','.join(
+ (str(x[2]), x[0], ','.join(x[1]))
+ )
+ for x in active_users
+ )),
+ content_type='text/csv',
+ headers={
+ 'Content-Disposition': f'attachment; filename=redakcja-{year}.csv',
+ }
+ )
+ else:
+ return render(request, 'documents/active_users_list.html', {
+ 'users': active_users,
+ 'year': year,
+ })