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

Not the same behavior as Django's default User #23

Open
ghost opened this issue Jul 1, 2015 · 5 comments
Open

Not the same behavior as Django's default User #23

ghost opened this issue Jul 1, 2015 · 5 comments

Comments

@ghost
Copy link

ghost commented Jul 1, 2015

This project's description is:

Custom user model for Django >= 1.5 with the same behaviour as Django's default User but with email instead of username.

The thing is, this custom user model doesn't have the same behavior as Django's default User. I expected this to be exactly the same as what I get with from django.contrib.auth.models import User, only without a username. It turns out that it's missing the first_name and last_name fields. Also, the get_full_name and get_short_name methods behave differently than Django's default User.

I propose that these differences be brought into alignment with Django's default behavior. Either that or change this project's description so that it's not misleading. Other than that, this project is great!

@jcugat
Copy link
Owner

jcugat commented Jul 9, 2015

Yes, that behaviour is different from Django's User model, but can be easily implemented as explained in https://github.com/jcugat/django-custom-user#extending-emailuser-model

Maybe it could be a good idea to add another model to this package (let's say DjangoEmailUser) with the fields first_name and last_name and both methods already implemented. Pull requests are welcome :)

@ghost
Copy link
Author

ghost commented Jul 23, 2015

Personally, I think it's cleaner and less confusing if this app just provides a single model. Currently, the email replacing the username is just one of the differences. Would you be open to having the existing EmailUser model modified so that the email replacing the username truly is the only difference? I think that's what most people are after anyway (and that's what this app's description says). I realize that's a pretty major change (and not backwards compatible), so maybe that would be a good time to bump the version up to 1.0. What do you think? Too drastic of a change? Are you set on having two separate models?

@halfnibble
Copy link

That is exactly what I'm looking for. Honestly, I can't believe there is not a package that does just that. There used to be, but it is no longer maintained, and doesn't support newer versions of Django.

@Plorenzo
Copy link

+1

@JehoshaphKEC
Copy link

I think having the first name and last name in the profile model rather than the user model makes more sense. It may take some additional effort moving it over initially but makes the project structure much cleaner:

  1. User model - contains user-specific unique stuff (email and password used to login)
  2. Profile model - contains profile stuff (including first and last name)

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

No branches or pull requests

4 participants