question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not the same behavior as Django's default User

See original GitHub issue

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!

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
JehoshaphKECcommented, Jul 13, 2016

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)
1reaction
jcugatcommented, 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 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using the Django authentication system
For projects where authentication needs differ from the default, Django supports ... Django does not store raw (clear text) passwords on the user...
Read more >
Why does Django's User Model set the email field as non ...
I am using Django's default User model and the email is not unique, now I have multiple users with the same email address....
Read more >
What You Should Know About The Django User Model
Even though the username field is marked as unique, by default it is not case-sensitive. That means the username john.doe and John.doe ...
Read more >
Django Tutorial Part 8: User authentication and permissions
If you log in using valid credentials, you'll be redirected to another page (by default this will be http://127.0.0.1:8000/accounts/profile/ ).
Read more >
Custom user models — django-registration 3.3 documentation
Django's built-in auth system provides a default model for user accounts, but also supports replacing that default with a custom user model.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found