-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
An encode error occur in Chapter11.3.1 if user.email is Null. #54
Comments
How to fix it ??? |
The It also does not hurt to add a check for |
Thanks, I have fixed it. |
@lambdaplus Note that you shouldn't be using data-test.sqlite, that is the database used by unit tests. |
oh oh oh, it should be the data-dev.sqlite. |
I have updated my comment. |
After execute command
Post.generate_fake(100)
in the chapter 11.3.1, an encode error occur like below:After the
git checkout 11c
, there is no column named 'user.email' in data-dev.sqlite.After executing the
python manage.py db upgrade
command, 'user.email' field of exiting data should be filled with Null, and this will cause an error on lineself.email.encode('utf-8')).hexdigest()
when generating the Gravatar URL.What should we do about this issue, set
user.email
NOT NULL or just do some extra check on gravatar() of app/models.py?The text was updated successfully, but these errors were encountered: