Commit bf5056d1 authored by Luko van der Maas's avatar Luko van der Maas
Browse files

Merge branch 'fix/members-overview-years' into 'master'

Do not show cohort 2019 yet on the members overview page

Closes #824

See merge request !1156
parents 8ffb11b4 4e449d11
...@@ -18,6 +18,7 @@ from rest_framework.response import Response ...@@ -18,6 +18,7 @@ from rest_framework.response import Response
import pizzas.services import pizzas.services
from members import services, emails from members import services, emails
from members.models import EmailChange, Membership from members.models import EmailChange, Membership
from utils.snippets import datetime_to_lectureyear
from . import models from . import models
from .forms import ProfileForm, EmailChangeForm from .forms import ProfileForm, EmailChangeForm
from .services import member_achievements from .services import member_achievements
...@@ -99,12 +100,9 @@ def index(request): ...@@ -99,12 +100,9 @@ def index(request):
page = request.GET.get('page') page = request.GET.get('page')
page = 1 if page is None or not page.isdigit() else int(page) page = 1 if page is None or not page.isdigit() else int(page)
start_year = date.today().year - 4 current_lectureyear = datetime_to_lectureyear(date.today())
# If language is English show one year less year_range = list(reversed(range(current_lectureyear - 5,
# since the width is smaller than needed for the translations to fit current_lectureyear + 1)))
if request.LANGUAGE_CODE == 'en':
start_year += 1
year_range = list(reversed(range(start_year, date.today().year + 1)))
members = filter_users(query_filter, keywords, year_range) members = filter_users(query_filter, keywords, year_range)
......
Markdown is supported
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