mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-06-16 12:10:39 +00:00
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."))
|