forms: Set realm_creation field one time when initializing form.

In commit c7a08f3b77, we started setting the realm_creation field
in both the RegistrationForm and its superclass, RealmDetailsForm,
which was likely a copy and paste error.

Since we only need to set the realm_creation field once when
initializing the form fields, we set it in the RealmDetailsForm,
which also removes any confusion related to the comment about
removing extra kwargs in the RegistrationForm initialization.
This commit is contained in:
Lauryn Menard
2025-09-14 14:26:46 +02:00
committed by Tim Abbott
parent b36f09c67f
commit 7185f2c236

View File

@@ -174,7 +174,6 @@ class RegistrationForm(RealmDetailsForm):
def __init__(self, *args: Any, **kwargs: Any) -> None:
# Since the superclass doesn't except random extra kwargs, we
# remove it from the kwargs dict before initializing.
self.realm_creation = kwargs["realm_creation"]
self.realm = kwargs.pop("realm", None)
super().__init__(*args, **kwargs)