Skip to content

Commit 858c24c

Browse files
committed
Refactor get_context_data to be in line with project convention
1 parent 0e189f0 commit 858c24c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/hidp/hidp/otp/views.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,7 @@ def get_form_kwargs(self):
201201
return kwargs
202202

203203
def get_context_data(self, **kwargs):
204-
context = super().get_context_data(**kwargs)
205-
206-
return context | {
204+
context = {
207205
"title": _("Set up two-factor authentication"),
208206
"device": self.device,
209207
"backup_device": self.backup_device,
@@ -215,6 +213,7 @@ def get_context_data(self, **kwargs):
215213
"back_url": reverse("hidp_otp_management:manage"),
216214
"logout_url": reverse("hidp_accounts:logout"),
217215
}
216+
return super().get_context_data() | context | kwargs
218217

219218
def form_valid(self, form):
220219
form.save()
@@ -281,10 +280,11 @@ def get_recovery_code_url(self, request): # noqa: PLR6301
281280
return base_url
282281

283282
def get_context_data(self, **kwargs):
284-
context = super().get_context_data(**kwargs)
285-
context["recovery_code_url"] = self.get_recovery_code_url(self.request)
286-
context["logout_url"] = reverse("hidp_accounts:logout")
287-
return context
283+
context = {
284+
"recovery_code_url": self.get_recovery_code_url(self.request),
285+
"logout_url": reverse("hidp_accounts:logout"),
286+
}
287+
return super().get_context_data() | context | kwargs
288288

289289

290290
class VerifyRecoveryCodeView(VerifyOTPBase):

0 commit comments

Comments
 (0)