Skip to content
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

MINOR REFACTOR #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Uncensored-Developer
Copy link

made some minor refactors like

  1. Changed a direct reference to the User model to AUTH_USER_MODEL for models.py and get_user_model anywhere else. This is better incase you change the User model (maybe to add extra fields) you would not have to make the change every else you used the User model. instead you just point to the new User model in the settings.py (AUTH_USER_MODEL="".

  2. Change the flutterwave private and secret key variables in settings.py to uppercase to follow the django convention.

  3. Change all direct reference to settings.py file to a dynamic reference (i.e from donaypay.settings to from django.conf import settings). This way is better because in a situation that the settings.py file is moved due to refactoring (maybe split into a different files for production, local and test) you would not have to go and make the changes everywhere you referenced the settings file directly.

  4. Removed some else statement that were not necessary because of the return statement at if the condition is met.

  5. Removed @staticmethod from the authenticate_user() method of LoginSerializer to have access to the validated_data so you do not have to pass the validated data again in the view.

  6. Removed the main app because it's not doing anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant