-
Notifications
You must be signed in to change notification settings - Fork 1
Fix/allow_registration_without_email_confirmation #103
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
Draft
gkijko
wants to merge
11
commits into
main
Choose a base branch
from
fix/simple_fix
base: main
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.
Draft
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
03456b6
back to dev
merwok a509661
Merge pull request #69 from caravancoop/post-release-merge
merwok 8bf70b3
update jinja2 from 2.10 to 2.10.1 (#76)
dependabot[bot] 51ab26f
update dependencies (#82)
merwok 2207f82
update pip-tools from 3.6.0 to 3.6.1 (#83)
dependabot[bot] f612dc7
update djangorestframework from 3.9.2 to 3.9.4 (#86)
dependabot-preview[bot] b37d04f
update django from 2.1.8 to 2.1.9 (#88)
dependabot[bot] 524b1dc
updqte django from 2.1.9 to 2.1.10 (#94)
dependabot-preview[bot] 339376e
update django from 2.1.10 to 2.1.11 (#101)
dependabot-preview[bot] 3a2a4e1
Fix typo in exception
gkijko 6918fa8
Registration without email confirmation
gkijko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# Changelog for Rest-Framework-Auth-Toolkit | ||
|
||
## v0.11 (unreleased) | ||
|
||
|
||
## v0.10 | ||
|
||
|
This file contains hidden or 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
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
"""Simple + flexible signup and login for Django APIs""" | ||
|
||
__version__ = '0.10' | ||
__version__ = '0.11.dev' | ||
|
||
default_app_config = 'rest_auth_toolkit.app.RestAuthToolkitConfig' |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,12 +51,15 @@ def post(self, request): | |
user = deserializer.save() | ||
|
||
if self.email_confirmation_class is None: | ||
raise MissingSetting('email_confirmation_string') | ||
raise MissingSetting('email_confirmation_class') | ||
|
||
confirmation = self.email_confirmation_class.objects.create(user=user) | ||
if get_setting('email_confirmation_send_email', True): | ||
email_field = user.get_email_field_name() | ||
send_email(request, user, getattr(user, email_field), confirmation) | ||
else: | ||
user.is_active = True | ||
user.save() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This wouldn’t be right for this class, but see the RestAuthToolkitMinimal app config class that doesn’t do user activation. |
||
|
||
return Response(status=status.HTTP_201_CREATED) | ||
|
||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think line 53 to 56 should go after the
if get_setting('email_confirmation_send_email', True):
That way there would be no need to define the email_confirmation_class if the email_confirmation_send_email is set to False.
Other option would be to let is as is and let the programer decide how he wants to validate the emails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the idea was that you always want a record in your DB (using your email confirmation class), but not always want to send actual email messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Problem is known #38 and has a PR #44