Skip to content

Commit

Permalink
Merge pull request #524 from dOpensource/v0.721
Browse files Browse the repository at this point in the history
Fixed issue with StirShaken not able to be disabled
  • Loading branch information
mackhendricks committed Jul 18, 2023
2 parents 973068e + 350e777 commit 281acc8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
12 changes: 11 additions & 1 deletion gui/dsiprouter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2176,7 +2176,14 @@ def displayStirShaken(msg=None):
return render_template('license_required.html',
msg='license is associated with another machine, re-associate it with this machine first')

return render_template('stirshaken.html', msg=msg)
if settings.STIR_SHAKEN_ENABLED == 1:
toggle_checked = 'checked'
options_hidden = 'hidden'
else:
toggle_checked = ''
options_hidden=''

return render_template('stirshaken.html', msg=msg,settings=settings,toggle_checked=toggle_checked,options_hidden=options_hidden)

except WoocommerceError as ex:
return render_template('license_required.html', msg=str(ex))
Expand Down Expand Up @@ -2222,6 +2229,9 @@ def addUpdateStirShaken():
if 'stir_shaken_enabled' in form:
tmp = form.get('stir_shaken_enabled', 0)
ss_settings["STIR_SHAKEN_ENABLED"] = 1 if tmp == "1" else 0
else:
ss_settings["STIR_SHAKEN_ENABLED"] = 0

if 'stir_shaken_prefix_a' in form:
ss_settings["STIR_SHAKEN_PREFIX_A"] = form.get('stir_shaken_prefix_a', '')
if 'stir_shaken_prefix_b' in form:
Expand Down
8 changes: 0 additions & 8 deletions gui/templates/stirshaken.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@
{% endblock %}

{% block body %}
{% if settings.STIR_SHAKEN_ENABLED == 1 %}
{% set toggle_checked = 'checked' %}
{% set options_hidden = 'hidden' %}
{% else %}
{% set toggle_checked = '' %}
{% set options_hidden = '' %}
{% endif %}

<div class="col-md-12">
<form action="/stirshaken" method="POST" role="form">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
Expand Down

0 comments on commit 281acc8

Please sign in to comment.