Skip to content

Commit

Permalink
refactor: Move registry.get_methods() call to separate method, to all…
Browse files Browse the repository at this point in the history
…ow customization

Refs jazzband#533
  • Loading branch information
last-partizan authored and claudep committed Sep 17, 2022
1 parent 6307db6 commit 8d1ecfe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion two_factor/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def get_form_list(self):
"""
form_list = super().get_form_list()

available_methods = registry.get_methods()
available_methods = self.get_available_methods()
if len(available_methods) == 1:
form_list.pop('method', None)
method_key = available_methods[0].code
Expand All @@ -497,6 +497,9 @@ def get_form_list(self):
form_list['validation'] = DeviceValidationForm
return form_list

def get_available_methods(self):
return registry.get_methods()

def render_next_step(self, form, **kwargs):
"""
In the validation step, ask the device to generate a challenge.
Expand Down

0 comments on commit 8d1ecfe

Please sign in to comment.