Skip to content

Commit 2681077

Browse files
committed
www: fix getting value of status field
Simply incorrect reference to the drop down menu containing the value of the status field. It's a select element and not an input! XHR for edit_prefix didn't even pick up on the status field, it does now! Fixes #625.
1 parent a15285a commit 2681077

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

nipap-www/nipapwww/controllers/xhr.py

+3
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,9 @@ def edit_prefix(self, id):
643643
else:
644644
p.node = request.params['node'].strip()
645645

646+
if 'status' in request.params:
647+
p.status = request.params['status'].strip()
648+
646649
if 'pool' in request.params:
647650
if request.params['pool'].strip() == '':
648651
p.pool = None

nipap-www/nipapwww/public/nipap.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2234,7 +2234,7 @@ function prefixFormSubmit(e) {
22342234
'tags': $('input[name="prefix_tags"]').val(),
22352235
'node': $('input[name="prefix_node"]').val(),
22362236
'type': $('input[name="prefix_type"]:checked').val(),
2237-
'status': $('input[name="prefix_status"]').val(),
2237+
'status': $('select[name="prefix_status"]').val(),
22382238
'country': $('input[name="prefix_country"]').val(),
22392239
'order_id': $('input[name="prefix_order_id"]').val(),
22402240
'customer_id': $('input[name="prefix_customer_id"]').val(),

nipap-www/nipapwww/templates/prefix_edit.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
'comment': $('input[name="prefix_comment"]').val(),
3434
'alarm_priority': $('input[name="prefix_alarm_priority"]:checked').val(),
3535
'vlan': $('input[name="prefix_vlan"]').val(),
36-
'status': $('input[name="prefix_status"]').val(),
36+
'status': $('select[name="prefix_status"]').val(),
3737
'tags': $("#tags").tagit("assignedTags")
3838
};
3939

nipap-www/nipapwww/templates/prefix_form.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ <h3 class="options-group-heading">Prefix options</h3>
7878
Status <span class="required tiptip" title="This field is required, please fill in! :-)">*</span>
7979
</dt>
8080
<dd>
81-
<select id="prefix_status">
81+
<select name="prefix_status">
8282
<option {% if c.prefix.status == 'assigned' %}selected{% endif %} value="assigned">Assigned</option>
8383
<option {% if c.prefix.status == 'reserved' %}selected{% endif %} value="reserved">Reserved</option>
8484
<option {% if c.prefix.status == 'quarantine' %}selected{% endif %} value="quarantine">Quarantine</option>

0 commit comments

Comments
 (0)