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

fixes install dependencies workflow and lint errors #115

Merged
merged 2 commits into from
Jan 14, 2022

Conversation

nb9960
Copy link
Member

@nb9960 nb9960 commented Jan 13, 2022

No description provided.

@Vikhyath08 Vikhyath08 merged commit b55c01b into IIT-BHU-InstiApp:master Jan 14, 2022
@@ -49,7 +49,7 @@ def validate(self, attrs):
raise serializers.ValidationError(
"Please login using @itbhu.ac.in student email id only")
name = jwt['name']
user = User()
user = get_user_model()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nb9960 Should this be user = get_user_model()() instead? I think this method returns a user model and not the user object.

Something like this should work imo:

UserModel = get_user_model()
user = UserModel()  # or user = UserModel.objects.create_user(...)
...
user.save()

cc: @Vikhyath08
IIT-BHU-InstiApp/IIT-BHU-app#339: Seems like this is a general issue, not related to branch changers.

I fixed a similar bug last time by just reverting the change 😛 (#76), but directly using User might not be good if someone is using custom user model.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing out the issue, Recent Commit should probably fix this!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! 🎉

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.

3 participants