diff --git a/passbook/stages/otp_static/migrations/0003_default_setup_flow.py.py b/passbook/stages/otp_static/migrations/0003_default_setup_flow.py.py index fa2e1f129..6bad90c52 100644 --- a/passbook/stages/otp_static/migrations/0003_default_setup_flow.py.py +++ b/passbook/stages/otp_static/migrations/0003_default_setup_flow.py.py @@ -29,6 +29,10 @@ def create_default_setup_flow(apps: Apps, schema_editor: BaseDatabaseSchemaEdito 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): diff --git a/passbook/stages/otp_static/templates/stages/otp_static/user_settings.html b/passbook/stages/otp_static/templates/stages/otp_static/user_settings.html index a54270c35..66081c593 100644 --- a/passbook/stages/otp_static/templates/stages/otp_static/user_settings.html +++ b/passbook/stages/otp_static/templates/stages/otp_static/user_settings.html @@ -26,7 +26,7 @@ {% if not state %} {% if stage.configure_flow %} - {% trans "Enable Static Tokens" %} + {% trans "Enable Static Tokens" %} {% endif %} {% else %} {% trans "Disable Static Tokens" %} diff --git a/passbook/stages/otp_time/migrations/0004_default_setup_flow.py b/passbook/stages/otp_time/migrations/0004_default_setup_flow.py index ee685b73b..46f019062 100644 --- a/passbook/stages/otp_time/migrations/0004_default_setup_flow.py +++ b/passbook/stages/otp_time/migrations/0004_default_setup_flow.py @@ -30,6 +30,10 @@ def create_default_setup_flow(apps: Apps, schema_editor: BaseDatabaseSchemaEdito 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): diff --git a/passbook/stages/otp_time/templates/stages/otp_time/user_settings.html b/passbook/stages/otp_time/templates/stages/otp_time/user_settings.html index 71789eee2..d3d0fd9db 100644 --- a/passbook/stages/otp_time/templates/stages/otp_time/user_settings.html +++ b/passbook/stages/otp_time/templates/stages/otp_time/user_settings.html @@ -22,7 +22,7 @@

{% if not state %} {% if stage.configure_flow %} - {% trans "Enable Time-based OTP" %} + {% trans "Enable Time-based OTP" %} {% endif %} {% else %} {% trans "Disable Time-based OTP" %}