File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 145145 SOCIALACCOUNT_ONLY = True
146146 ACCOUNT_EMAIL_VERIFICATION = 'none'
147147
148+ # need to remove mfa as not compatible with this setting
149+ INSTALLED_APPS .remove ('allauth.mfa' ) # noqa: F405
150+
148151 OIDC_GROUPS_CLAIM = environ .get ('OIDC_GROUPS_CLAIM' , 'groups' )
149152 OIDC_ADMIN_GROUP = environ .get ('OIDC_ADMIN_GROUP' , '' )
150153 OIDC_EXTRA_SCOPE = environ .get ('OIDC_EXTRA_SCOPE' , '' )
Original file line number Diff line number Diff line change @@ -191,6 +191,11 @@ def test_settings_edit_cancel_viewer_settings(self):
191191 self .page .get_by_text ("Cancel" ).click ()
192192 expect (self .page .locator (name )).to_contain_text ('Edit' )
193193
194+ def test_settings_mfa_edit_visible (self ):
195+ with sync_playwright () as p :
196+ self .open (reverse ('account_settings' ), p )
197+ expect (self .page .locator ('#edit_mfa' )).to_be_visible ()
198+
194199 def test_settings_mfa_activated (self ):
195200 Authenticator .objects .create (user = self .user , type = 'totp' , data = {})
196201
Original file line number Diff line number Diff line change @@ -191,9 +191,12 @@ def collections(self) -> QuerySet:
191191 def mfa_activated (self ) -> bool :
192192 """Check if multi factor authentication is activated"""
193193
194- if self .user .authenticator_set .count ():
195- return True
196- else :
194+ try :
195+ if self .user .authenticator_set .count ():
196+ return True
197+ else :
198+ return False
199+ except AttributeError : # pragma: no cover
197200 return False
198201
199202 @property
Original file line number Diff line number Diff line change 7171 {% endif %}
7272 </ div >
7373 < div class ="pr-0 md:pr-6 ">
74- < a id ="edit_mfa " href ="{% url 'mfa_index' %} " class ="cursor-pointer text-primary hover:text-secondary ">
74+ {% url 'mfa_index' as mfa_index_url %}
75+ {% if mfa_index_url %}
76+ < a id ="edit_mfa " href ="{{ mfa_index_url }} " class ="cursor-pointer text-primary hover:text-secondary ">
7577 Edit
7678 </ a >
79+ {% endif %}
7780 </ div >
7881 </ div >
7982 {% endif %}
You can’t perform that action at this time.
0 commit comments