Manual email confirm (#2492)
* manual approve email via bw-dev/manage.py ./bw-dev confirm_email USER (venv) python manage.py confirm_email USER * add "confirm_email" and "remove_2fa" to autocompletion * OK, sometimes I feel fooled by this. The lione was not LONG ENOUGH. * Change deactivate reason to None * Whyever this works now Python in my system is a wondermachine.
This commit is contained in:
parent
a9846e7805
commit
ea316627be
5 changed files with 31 additions and 0 deletions
19
bookwyrm/management/commands/confirm_email.py
Normal file
19
bookwyrm/management/commands/confirm_email.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
""" manually confirm e-mail of user """
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
from bookwyrm import models
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
"""command-line options"""
|
||||
|
||||
help = "Manually confirm email for user"
|
||||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument("username")
|
||||
|
||||
def handle(self, *args, **options):
|
||||
name = options["username"]
|
||||
user = models.User.objects.get(localname=name)
|
||||
user.reactivate()
|
||||
self.stdout.write(self.style.SUCCESS("User's email is now confirmed."))
|
Loading…
Add table
Add a link
Reference in a new issue