mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 15:59:18 +02:00
Fixed issue with confirmation email not sending when signup-approval was enabled
This commit is contained in:
parent
e812de28c8
commit
a20a63d6ed
2 changed files with 15 additions and 1 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue