stages/otp_: ensure stage.configure_flow is set
This commit is contained in:
parent
52101007aa
commit
84da454612
|
@ -29,6 +29,10 @@ def create_default_setup_flow(apps: Apps, schema_editor: BaseDatabaseSchemaEdito
|
||||||
target=flow, stage=stage, defaults={"order": 0}
|
target=flow, stage=stage, defaults={"order": 0}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
for stage in OTPStaticStage.objects.using(db_alias).filter(configure_flow=None):
|
||||||
|
stage.configure_flow = flow
|
||||||
|
stage.save()
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
{% if not state %}
|
{% if not state %}
|
||||||
{% if stage.configure_flow %}
|
{% if stage.configure_flow %}
|
||||||
<a href="{% url 'passbook-flows:configure' stage_uuid=stage.stage_uuid %}" class="pf-c-button pf-m-primary">{% trans "Enable Static Tokens" %}</a>
|
<a href="{% url 'passbook_flows:configure' stage_uuid=stage.stage_uuid %}" class="pf-c-button pf-m-primary">{% trans "Enable Static Tokens" %}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<a href="{% url 'passbook_stages_otp_static:disable' stage_uuid=stage.stage_uuid %}" class="pf-c-button pf-m-danger">{% trans "Disable Static Tokens" %}</a>
|
<a href="{% url 'passbook_stages_otp_static:disable' stage_uuid=stage.stage_uuid %}" class="pf-c-button pf-m-danger">{% trans "Disable Static Tokens" %}</a>
|
||||||
|
|
|
@ -30,6 +30,10 @@ def create_default_setup_flow(apps: Apps, schema_editor: BaseDatabaseSchemaEdito
|
||||||
target=flow, stage=stage, defaults={"order": 0}
|
target=flow, stage=stage, defaults={"order": 0}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
for stage in OTPTimeStage.objects.using(db_alias).filter(configure_flow=None):
|
||||||
|
stage.configure_flow = flow
|
||||||
|
stage.save()
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
<p>
|
<p>
|
||||||
{% if not state %}
|
{% if not state %}
|
||||||
{% if stage.configure_flow %}
|
{% if stage.configure_flow %}
|
||||||
<a href="{% url 'passbook-flows:configure' stage_uuid=stage.stage_uuid %}" class="pf-c-button pf-m-primary">{% trans "Enable Time-based OTP" %}</a>
|
<a href="{% url 'passbook_flows:configure' stage_uuid=stage.stage_uuid %}" class="pf-c-button pf-m-primary">{% trans "Enable Time-based OTP" %}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<a href="{% url 'passbook_stages_otp_time:disable' stage_uuid=stage.stage_uuid %}" class="pf-c-button pf-m-danger">{% trans "Disable Time-based OTP" %}</a>
|
<a href="{% url 'passbook_stages_otp_time:disable' stage_uuid=stage.stage_uuid %}" class="pf-c-button pf-m-danger">{% trans "Disable Time-based OTP" %}</a>
|
||||||
|
|
Reference in New Issue