mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-05-13 14:02:57 +00:00
ea316627be
* 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.
20 lines
543 B
Python
20 lines
543 B
Python
""" 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."))
|