Skip to content

Typo on page 220 - User used without importationΒ #28

@arbayong

Description

@arbayong

on page 220, both user and profile edit forms in their clean functions use the line
User.objects......
but User has not been imported from django.contrib.auth

the UserRegistration form relies on the get_user_model() function to get the user model. thus User is not define.

i solved this by replacing User with get_user_model().objects.filter(....) each time.
I'm sure when importing the get_user_model we can import it and give it an alias say UserModel.
in that case the model attribute of the UserRegitration Form must point to this alias as using get_user_model() will throw and exception

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions