Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arthur Brugière
funkwhale
Commits
a20a63d6
Unverified
Commit
a20a63d6
authored
4 years ago
by
Agate
💬
Browse files
Options
Downloads
Patches
Plain Diff
Fixed issue with confirmation email not sending when signup-approval was enabled
parent
e812de28
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/funkwhale_api/users/views.py
+8
-0
8 additions, 0 deletions
api/funkwhale_api/users/views.py
api/tests/users/test_views.py
+7
-1
7 additions, 1 deletion
api/tests/users/test_views.py
with
15 additions
and
1 deletion
api/funkwhale_api/users/views.py
+
8
−
0
View file @
a20a63d6
...
...
@@ -5,6 +5,7 @@ from rest_framework import mixins, viewsets
from
rest_framework.decorators
import
action
from
rest_framework.response
import
Response
from
funkwhale_api.common
import
authentication
from
funkwhale_api.common
import
preferences
from
.
import
models
,
serializers
,
tasks
...
...
@@ -26,6 +27,13 @@ class RegisterView(registration_views.RegisterView):
def
is_open_for_signup
(
self
,
request
):
return
get_adapter
().
is_open_for_signup
(
request
)
def
perform_create
(
self
,
serializer
):
user
=
super
().
perform_create
(
serializer
)
if
not
user
.
is_active
:
# manual approval, we need to send the confirmation email by hand
authentication
.
send_email_confirmation
(
self
.
request
,
user
)
return
user
class
VerifyEmailView
(
registration_views
.
VerifyEmailView
):
action
=
"
verify-email
"
...
...
This diff is collapsed.
Click to expand it.
api/tests/users/test_views.py
+
7
−
1
View file @
a20a63d6
...
...
@@ -418,7 +418,9 @@ def test_username_with_existing_local_account_are_invalid(
assert
"
username
"
in
response
.
data
def
test_signup_with_approval_enabled
(
preferences
,
factories
,
api_client
,
mocker
):
def
test_signup_with_approval_enabled
(
preferences
,
factories
,
api_client
,
mocker
,
mailoutbox
,
settings
):
url
=
reverse
(
"
rest_register
"
)
data
=
{
"
username
"
:
"
test1
"
,
...
...
@@ -455,6 +457,10 @@ def test_signup_with_approval_enabled(preferences, factories, api_client, mocker
new_status
=
"
pending
"
,
)
confirmation_message
=
mailoutbox
[
-
1
]
assert
"
confirm
"
in
confirmation_message
.
body
assert
settings
.
FUNKWHALE_HOSTNAME
in
confirmation_message
.
body
def
test_signup_with_approval_enabled_validation_error
(
preferences
,
factories
,
api_client
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment