Adds command to get admin code
This commit is contained in:
18
bookwyrm/management/commands/admin_code.py
Normal file
18
bookwyrm/management/commands/admin_code.py
Normal file
@ -0,0 +1,18 @@
|
||||
""" Get your admin code to allow install """
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
from bookwyrm import models
|
||||
|
||||
def get_admin_code():
|
||||
"""get that code"""
|
||||
return models.SiteSettings.objects.get().admin_code
|
||||
|
||||
class Command(BaseCommand):
|
||||
"""command-line options"""
|
||||
|
||||
help = "Gets admin code for configuring BookWyrm"
|
||||
|
||||
# pylint: disable=unused-argument
|
||||
def handle(self, *args, **options):
|
||||
"""execute init"""
|
||||
self.stdout.write(get_admin_code())
|
Reference in New Issue
Block a user