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

Registration #11

Open
wants to merge 29 commits into
base: development
Choose a base branch
from
Open

Registration #11

wants to merge 29 commits into from

Conversation

Mischback
Copy link
Owner

Building new feature registration

Will close #1, #9

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.
@Mischback Mischback added the enhancement New feature or request label Mar 19, 2018
@Mischback Mischback added this to the Release 1.0.0 milestone Mar 19, 2018
@Mischback Mischback self-assigned this Mar 19, 2018
@Mischback Mischback added this to In progress in Roadmap Mar 19, 2018
@coveralls
Copy link

coveralls commented Mar 19, 2018

Pull Request Test Coverage Report for Build 42

  • 422 of 422 (100.0%) changed or added relevant lines in 12 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 100.0%

Totals Coverage Status
Change from base Build 24: 0.2%
Covered Lines: 903
Relevant Lines: 903

💛 - Coveralls

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
Labels
enhancement New feature or request
Projects
Roadmap
  
In progress
Development

Successfully merging this pull request may close these issues.

Registration
2 participants