diff --git a/memopol/views/representative_mixin.py b/memopol/views/representative_mixin.py index 98b27d40413a84fe9e906386b131f93c219224a2..55547c693bf6d56371f15e16888109a7d50aa72d 100644 --- a/memopol/views/representative_mixin.py +++ b/memopol/views/representative_mixin.py @@ -1,7 +1,5 @@ # coding: utf-8 -import datetime - from django.db import models from representatives.models import Mandate @@ -35,7 +33,6 @@ class RepresentativeViewMixin(object): Note that this will butcher your database if you don't use self.prefetch_related. """ - today = datetime.date.today() representative.country = None representative.main_mandate = None @@ -44,8 +41,7 @@ class RepresentativeViewMixin(object): if m.constituency.country_id and not representative.country: representative.country = m.constituency.country - if ((m.end_date is None or m.end_date > today) and - m.group.kind == 'group' and + if (m.group.kind == 'group' and not representative.main_mandate): representative.main_mandate = m