Skip to content
Extraits de code Groupes Projets
Valider edee20ee rédigé par Arnaud Fabre's avatar Arnaud Fabre
Parcourir les fichiers

edits on groups

parent a231f56e
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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',
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter