Commit edee20ee authored by Arnaud Fabre's avatar Arnaud Fabre

edits on groups

parent a231f56e
......@@ -29,11 +29,12 @@ class Command(BaseCommand):
# Group creation
try:
mgroup = MGroup(group_ptr=mandate.group)
mgroup = MGroup.objects.get(group_ptr=mandate.group)
except MGroup.DoesNotExist:
mgroup = MGroup(group_ptr=mandate.group)
mgroup.__dict__.update(mandate.group.__dict__)
mgroup.save()
#print(mgroup)
mmandate.mgroup = mgroup
mmandate.save()
......@@ -47,4 +48,3 @@ class Command(BaseCommand):
print('Groups')
for i, mgroup in enumerate(MGroup.objects.all()):
mgroup.update_active()
......@@ -31,7 +31,7 @@
<p>
{{ mandate.begin_date }} to {{ mandate.end_date }} <br>
<a href="{{ mandate|by_mandate_url }}">
<strong>{{ mandate.group.kind }}</strong> : <em>{{ mandate.group.name }} ({{ mandate.group.abbreviation }})</em>
<strong>{{ mandate.group.kind }}</strong> : <em>{{ mandate.group.name }} ({{ mandate.group.abbreviation }})</em>
</a>
<br>
Constituency : {{ mandate.constituency.name }} <br>
......
......@@ -17,6 +17,7 @@ def representatives_index(request):
def representative_by_name(request, name):
representative = get_object_or_404(
MRepresentative, full_name=name)
return render(
request,
'legislature/representative_view.html',
......@@ -26,7 +27,6 @@ def representative_by_name(request, name):
def representative_view(request, num):
representative = get_object_or_404(MRepresentative, pk=num)
return render(
request,
'legislature/representative_view.html',
......
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