-
Notifications
You must be signed in to change notification settings - Fork 1.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
Overriding validation #879
Comments
I have the same question. 2014-11-28 16:46 GMT+08:00 Salvatore notifications@github.com:
|
Ok, it could be a workaround for the password, but what about email uniqueness? I would allow multiple accounts with same email. |
It is not possible to drop the uniqueness constraint on User email. |
But @bajtos , the mere fact that So, can I really not override the uniqueness of Please can you confirm that it's still true there's no solution for me? It's really hard to believe I would have to build my own (And before you ask -- of course it makes sense to have multiple or even no email addresses associated with User. There are many examples, among them: (1) migrating accounts from an old system where
So for my use-case, am I forced to either build my own User model from the ground up, or to finagle fake email addresses that are unique just to satisfy this constraint? Am I really in the minority wanting this functionality? Thanks. Steve |
Ah hah -- man, sometimes it's really hard piecing together what's what from a Google search given how active development is on this (though, that's a good thing of course). Anyway, I think I figured out that in fact you do correctly support this dichotomy of uses in the current implementation of the built-in User model (as of 2016, anyway). I see in the code, all I needed to do was add
With So that's pretty much just what I needed in my case (I am fine requiring Thanks a lot -- I'm good to go. Though as usual, maybe there's something I can do to help improve the docs, will look at it again later and update this if so with proposed improvement (or not :-) ). Steve |
In the sample below, I remove everything from the custom
Some ideas came from: issue #1137 How can this be helpful? Well what if you're trying to experiment with a multi-tenant setup where |
In your built-in user model inside, a lot of places to use the mailbox this thing, so can not simply delete this thing. Delete will influence to reset the password, and even affect the secret key generation, I think we should provide an optional project, configuration into the phone number or e-mail address, user name is to make configuration options for unique personality, but need to choose a as a unique ID. |
In my example code in my previous comment, I am not changing the built-in |
@pulkitsinghal , I'm not saying you destroy something, I think if you do not use it's own mailbox, then how to generate the user's token it, then you have to write your own method of generating token, there is a lot of built-in methods you can not use the fact, I think if we do so, not as a direct write a model, rather than inherited user. I look at the code inside the user's login and also implements several methods to create a similar, but those methods and mailbox properties coupled together. |
I have a class
MyUser
which extends built-inUser
.How can I remove default validation (like the one on email and password)?
The text was updated successfully, but these errors were encountered: