-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from eduNEXT/and/set_gender_options
feat: add gender choices patch
- Loading branch information
Showing
5 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
""" | ||
This file contains all the processes that must run after app registration. | ||
Functions: | ||
run_init_pipeline: Wrapper for all the init methods, this avoids to import methods outside this file. | ||
patch_user_gender_choices: Change the current openedx gender options (Male, Female, Other) | ||
""" | ||
from django.utils.translation import gettext_noop | ||
|
||
|
||
def run_init_pipeline(): | ||
""" | ||
Executes multiple processes that must run before starting the django application. | ||
""" | ||
patch_user_gender_choices() | ||
|
||
|
||
def patch_user_gender_choices(): | ||
""" | ||
This overwrites the available gender choices in order to allow the Male and Female options. | ||
""" | ||
# pylint: disable=import-error, import-outside-toplevel | ||
# This cannot be at the top of the file since this file is imported the plugin initialization | ||
# and therefore the settings has not been set yet | ||
from eox_nelp.edxapp_wrapper.student import UserProfile | ||
|
||
UserProfile.GENDER_CHOICES = ( | ||
('m', gettext_noop('Male')), | ||
('f', gettext_noop('Female')), | ||
) |