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

Useraudit and Custom User model #12

Closed
dedayoa opened this issue Jan 3, 2017 · 2 comments
Closed

Useraudit and Custom User model #12

dedayoa opened this issue Jan 3, 2017 · 2 comments

Comments

@dedayoa
Copy link

dedayoa commented Jan 3, 2017

I stumbled upon useraudit and I've been enjoying using it. However, for this project, I had to implement a custom user model - extending AbstractBaseUser.
Rather than having a "username", this project requires a "phone_number" as the username, and this leads to useraudit not displaying anything in the username field (in admin), and not having any value stored for username in the db.

Is there a work around for this situation? I'm running Django 1.10.4
Regards,

@sztamas
Copy link
Contributor

sztamas commented Jan 9, 2017

Hi,

Currently, that isn't supported.

Would setting up an alias property be acceptable for you?

class YourCustomUser(AbstractBaseUser):
    ...
    @property
    def username(self):
        return self.phone_number
    ...

I think that should work, please let us know if there are any problems with it.

Cheers,

Tamas

@sztamas
Copy link
Contributor

sztamas commented Aug 11, 2017

Closing this as it is pretty old now.

@sztamas sztamas closed this as completed Aug 11, 2017
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

2 participants