-
Notifications
You must be signed in to change notification settings - Fork 0
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
Registration #11
Open
Mischback
wants to merge
29
commits into
development
Choose a base branch
from
registration
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Registration #11
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Instead of implementing all details of an user, rely on Django's codebase and just extend, where absolutely necessary. So, MiniUser now inherits AbstractUser, but still applies the custom MiniUserManager. In MiniUser, the email field is redefined to make it unique (if set) and to include a verification flag.
Fun fact: Django automatically registers a receiver for the user_logged_in signal and updates a 'last_login' field on the active AUTH_USER_MODEL, even if Django's default User doesn't even have that field! So, I didn't notice that *my* own callback wasn't even executed, though the last_login-field got updated during manual testing. Currently, the test regarding the app's callback is skipped, because I could not get it working using the mock-library and Django's test-client.
Now, let's start some TTD. How should signup react with different settings?
MiniUser means: only request minimum information from the user. So, if no valid email address is required, don't ask the user about it.
Made sure to call the model's clean() where needed to apply some everytime validations
Regarding commit c8b6eed: Ok, I found out, where Django defined last_login by default, so no more need to provide it as an own field in our custom model. Get rid of it and all associated code.
Pull Request Test Coverage Report for Build 42
💛 - Coveralls |
Ok, in fact, no Exceptions are probably best.
This means, no database request will be made IOT send mails. But it relies on a sane project configuration.
Yeah, now it behaves consistently across bulk and non-bulk methods and is testable. Coverage back up to 100%
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Building new feature registration
Will close #1, #9