DiptoChakrabarty / flask-online-store

An online e commerce stores management and order placing system API built using flask and sqlalchemy . Various functionalities present and further functionalities being added to make it as real life as possible . Contributions welcome .
MIT License
49 stars 23 forks source link

Add nullable=True to User model #11

Closed gabrielhicks closed 4 years ago

gabrielhicks commented 4 years ago

Added a nullable=True to users table in password column.

DiptoChakrabarty commented 4 years ago

Currently adding nullable as False would restrict oauth logins so for now I have removed it from database rules but that would mean to tell users to enter no password and that is a bug

gabrielhicks commented 4 years ago

Thank you, I will look at it again, if anyone else is interested in working on this in the meantime please allow them to do that!

gabrielhicks commented 4 years ago

I attempted again, I am unsure if I am on the right path

gabrielhicks commented 4 years ago

Going to make this a method instead.

gabrielhicks commented 4 years ago

Im not confident, but I feel this is a better approach. I first created an instance method, but I think that would not work, so I made it a class method and hope that can work. Thank you for letting me give it a shot!

gabrielhicks commented 4 years ago

Im going to look back at the code and find where the oauth user is being created. Im re-reading your comments and thinking maybe that is where I should go to fix the missing parameter.

gabrielhicks commented 4 years ago

I moved the generate password method into the github_login file, passed a generated password as params into each instantiation of a new user, and set the nullable=True in the Users table. I think this should work and I feel more confident in this solution. @DiptoChakrabarty

DiptoChakrabarty commented 4 years ago

Hey this looks good can you please send the PR to the development branch from where I will merge to master . This is the flow I am following actually .