Registration: authority selected after error in the form using POST value
[unfold.git] / portal / templates / registration_view.html
index 8ad3bf5..4d09858 100644 (file)
                 {% if authorities %}
                     {% for authority in authorities %}
                         {% if authority.name %}
-                            <option value="{{ authority.authority_hrn }}">{{authority.name}}</option>
+                            {% if authority.authority_hrn == authority_hrn %}
+                                <option value="{{ authority.authority_hrn }}" selected>{{authority.name}}</option>
+                            {% else %}
+                                <option value="{{ authority.authority_hrn }}">{{authority.name}}</option>
+                            {% endif %}
                         {% else %}
+                            {% if authority.authority_hrn == authority_hrn %}
+                            <option value="{{ authority.authority_hrn }}" selected>{{authority.authority_hrn}}</option>
+                            {% else %}
                             <option value="{{ authority.authority_hrn }}">{{authority.authority_hrn}}</option>
+                            {% endif %}
                         {% endif %}
-                    {% endfor %}    
+                    {% endfor %}
                 {% else %}
                     <option value:"">No authority found !!!</option>
                 {% endif %}