2
0
Эх сурвалжийг харах

better to log before doing a thing than after

Nick Sweeting 2 жил өмнө
parent
commit
d286dca925

+ 1 - 1
archivebox/main.py

@@ -425,8 +425,8 @@ def init(force: bool=False, quick: bool=False, setup: bool=False, out_dir: Path=
     from django.contrib.auth.models import User
     from django.contrib.auth.models import User
 
 
     if (ADMIN_USERNAME and ADMIN_PASSWORD) and not User.objects.filter(username=ADMIN_USERNAME).exists():
     if (ADMIN_USERNAME and ADMIN_PASSWORD) and not User.objects.filter(username=ADMIN_USERNAME).exists():
-        User.objects.create_superuser(username=ADMIN_USERNAME, password=ADMIN_PASSWORD)
         print('{green}[+] Found ADMIN_USERNAME and ADMIN_PASSWORD configuration options, creating new admin user.{reset}'.format(**ANSI))
         print('{green}[+] Found ADMIN_USERNAME and ADMIN_PASSWORD configuration options, creating new admin user.{reset}'.format(**ANSI))
+        User.objects.create_superuser(username=ADMIN_USERNAME, password=ADMIN_PASSWORD)
 
 
     if existing_index:
     if existing_index:
         print('{green}[√] Done. Verified and updated the existing ArchiveBox collection.{reset}'.format(**ANSI))
         print('{green}[√] Done. Verified and updated the existing ArchiveBox collection.{reset}'.format(**ANSI))