@@ -799,7 +799,7 @@ def start(self):
799
799
return self ._user_module .render .edit (
800
800
self .OtpSkel (),
801
801
params = {
802
- "name" : i18n .translate ("viur.core.modules.user." + self .NAME ),
802
+ "name" : i18n .translate (f "viur.core.modules.user.{ self .NAME } " ),
803
803
"action_name" : self .ACTION_NAME ,
804
804
"action_url" : f"{ self .modulePath } /{ self .ACTION_NAME } " ,
805
805
},
@@ -843,7 +843,7 @@ def otp(self, *args, **kwargs):
843
843
skel .errors = [ReadFromClientError (ReadFromClientErrorSeverity .Invalid , "Wrong OTP Token" , ["otptoken" ])]
844
844
return self ._user_module .render .edit (
845
845
skel ,
846
- name = i18n .translate ("viur.core.modules.user.auth." + self .NAME ),
846
+ name = i18n .translate (f "viur.core.modules.user.auth.{ self .NAME } " ),
847
847
action_name = self .ACTION_NAME ,
848
848
action_url = f"{ self .modulePath } /{ self .ACTION_NAME } " ,
849
849
tpl = self .second_factor_login_template
@@ -981,23 +981,23 @@ def add(self, otp=None):
981
981
return self ._user_module .render .second_factor_add (
982
982
tpl = self .second_factor_add_template ,
983
983
action_name = self .ACTION_NAME ,
984
- name = i18n .translate ("viur.core.modules.user.auth." + self .NAME ),
984
+ name = i18n .translate (f "viur.core.modules.user.auth.{ self .NAME } " ),
985
985
add_url = self .add_url ,
986
986
otp_uri = AuthenticatorOTP .generate_otp_app_secret_uri (otp_app_secret ))
987
987
else :
988
988
if not AuthenticatorOTP .verify_otp (otp , otp_app_secret ):
989
989
return self ._user_module .render .second_factor_add (
990
990
tpl = self .second_factor_add_template ,
991
991
action_name = self .ACTION_NAME ,
992
- name = i18n .translate ("viur.core.modules.user.auth." + self .NAME ),
992
+ name = i18n .translate (f "viur.core.modules.user.auth.{ self .NAME } " ),
993
993
add_url = self .add_url ,
994
994
otp_uri = AuthenticatorOTP .generate_otp_app_secret_uri (otp_app_secret )) # to add errors
995
995
996
996
# Now we can set the otp_app_secret to the current User and render der Success-template
997
997
AuthenticatorOTP .set_otp_app_secret (otp_app_secret )
998
998
return self ._user_module .render .second_factor_add_success (
999
999
action_name = self .ACTION_NAME ,
1000
- name = i18n .translate ("viur.core.modules.user.auth." + self .NAME ),
1000
+ name = i18n .translate (f "viur.core.modules.user.auth.{ self .NAME } " ),
1001
1001
)
1002
1002
1003
1003
def can_handle (self , skel : skeleton .SkeletonInstance ) -> bool :
@@ -1073,7 +1073,7 @@ def start(self):
1073
1073
return self ._user_module .render .edit (
1074
1074
TimeBasedOTP .OtpSkel (),
1075
1075
params = {
1076
- "name" : i18n .translate ("viur.core.modules.user.auth." + self .NAME ),
1076
+ "name" : i18n .translate (f "viur.core.modules.user.auth.{ self .NAME } " ),
1077
1077
"action_name" : self .ACTION_NAME ,
1078
1078
"action_url" : self .action_url ,
1079
1079
},
@@ -1112,7 +1112,7 @@ def authenticator_otp(self, **kwargs):
1112
1112
skel .errors = [ReadFromClientError (ReadFromClientErrorSeverity .Invalid , "Wrong OTP Token" , ["otptoken" ])]
1113
1113
return self ._user_module .render .edit (
1114
1114
skel ,
1115
- name = i18n .translate ("viur.core.modules.user.auth." + self .NAME ),
1115
+ name = i18n .translate (f "viur.core.modules.user.auth.{ self .NAME } " ),
1116
1116
action_name = self .ACTION_NAME ,
1117
1117
action_url = self .action_url ,
1118
1118
tpl = self .second_factor_login_template ,
0 commit comments