correct linter errors

./bw-dev black

reformatted bookwyrm/management/commands/remove_2fa.py

All done!  🍰 
1 file reformatted, 544 files left unchanged.
This commit is contained in:
Jascha Urbach 2022-11-15 23:32:24 +01:00
parent cd57537854
commit 8a99482a2f
No known key found for this signature in database
GPG key ID: A43A844B114F9B08

View file

@ -3,16 +3,20 @@
from django.core.management.base import BaseCommand, CommandError
from bookwyrm import models
class Command(BaseCommand):
"""command-line options"""
help = "Remove Two Factor Authorisation from user"
"""command-line options"""
def add_arguments(self, parser):
parser.add_argument("username")
help = "Remove Two Factor Authorisation from user"
def handle(self, *args, **options):
name = (options["username"])
user = models.User.objects.get(localname=name)
user.two_factor_auth = False
user.save(broadcast=False, update_fields=["two_factor_auth"])
self.stdout.write(self.style.SUCCESS("Two Factor Authorisation was removed from 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.two_factor_auth = False
user.save(broadcast=False, update_fields=["two_factor_auth"])
self.stdout.write(
self.style.SUCCESS("Two Factor Authorisation was removed from user")
)