Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Commit

Permalink
Explicitly select the Gouvernement option by default
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbgk committed Apr 21, 2020
1 parent 3ba6651 commit be2cf37
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions repondeur/zam_repondeur/visam/templates/amendements_add.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ <h2 class="subtitle">{{ lecture.dossier.titre }}</h2>
<div class="form-group">
<label for="organisation">Soumis par</label>
<select name="organisation" class="form-control" required>
{% for organisation in organisations %}
<option value="{{ organisation.name }}" {% if loop.first %}selected{% endif %}>{{ organisation.name }}</option>
<option value="{{ gouvernement.name }}" selected>{{ gouvernement.name }}</option>
{% for organisation in organisations_except_gouvernement %}
<option value="{{ organisation.name }}">{{ organisation.name }}</option>
{% endfor %}
</select>
</div>
Expand Down
5 changes: 4 additions & 1 deletion repondeur/zam_repondeur/visam/views/amendements_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ def get(self) -> dict:
"current_tab": "saisie-amendement",
"lecture": self.lecture,
"can_select_organisation": self.can_select_organisation(),
"organisations": DBSession.query(Organisation).all(),
"gouvernement": Organisation.find_by_name("Gouvernement"),
"organisations_except_gouvernement": DBSession.query(Organisation)
.filter(Organisation.name != "Gouvernement")
.all(),
"subdivs": [
(article.url_key, str(article))
for article in sorted(self.lecture.articles)
Expand Down

0 comments on commit be2cf37

Please sign in to comment.