-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PADV-1556 Create custom form for registration extra fields. #129
Conversation
@@ -298,13 +298,15 @@ def cleaned_extended_profile(self): | |||
|
|||
def get_registration_extension_form(*args, **kwargs): | |||
""" | |||
Convenience function for getting the custom form set in settings.REGISTRATION_EXTENSION_FORM. | |||
Convenience function for getting the custom form set in site configurations REGISTRATION_EXTENSION_FORM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The purpose of adding site configuration support to a Django setting is to support both the site configuration and the default Django configuration. We should not remove backwards compatibility in case there are no sites configured or it is a single site installation. @Nekenhei
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I'll implement a solution that prioritize the site configurations over the platform settings.
return None | ||
module, klass = settings.REGISTRATION_EXTENSION_FORM.rsplit('.', 1) | ||
# No Default valued is passed since we prioritize site configurations over site settings. | ||
registration_extra_form = configuration_helpers.get_value('REGISTRATION_EXTENSION_FORM', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should keep checking the existence of the default value, as it's now, it will throw an error if the setting is not present. Also if the setting is present but is None, it will fail on line 310. @Nekenhei
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Squirrel18 you're right, I've removed by error an if statement that handles the situation when none of the sources has the setting set.
In the original code, the default value was none, so I changed to firstly check for site conf, then plataform settings and if none of them are presented, return None as it's working on master.
ccbd943
to
66471bb
Compare
Tickets
Description
Change REGISTRATION_EXTENSION_FORM platform setting and turns it into a site awareness feature
Changes Made
How To Test
This feature could be fully tested along with https://github.com/Pearson-Advance/pearson-core/pull/53
Nonetheless, you could follow the next steps to test it into the platform: