Commit 7cd9b63b authored by Nicolas Joyard's avatar Nicolas Joyard
Browse files

Use last mandate as main_mandate even when finished

parent 5457ba81
# 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
today = = None
representative.main_mandate = None
......@@ -44,8 +41,7 @@ class RepresentativeViewMixin(object):
if m.constituency.country_id and not =
if ((m.end_date is None or m.end_date > today) and == 'group' and
if ( == 'group' and
not representative.main_mandate):
representative.main_mandate = m
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