Fixes to initial_startup.

This commit is contained in:
Griatch 2015-01-18 21:40:14 +01:00
parent 1a73f86690
commit 786a97a5b0

View file

@ -24,13 +24,15 @@ def get_god_player():
""" """
Creates the god user and don't take no for an answer. Creates the god user and don't take no for an answer.
""" """
god_player = None try:
while not god_player: god_player = PlayerDB.objects.get(id=1)
try: except PlayerDB.DoesNotExist:
god_player = PlayerDB.objects.get(id=1) txt = "\n\nNo superuser exists yet. The superuser is the 'owner'\n" \
except PlayerDB.DoesNotExist: "account on the Evennia server. Create a new superuser using\n" \
print "\nCreate a superuser below. The superuser is Player #1, the 'owner' account of the server.\n" "the command\n\n" \
django.core.management.call_command("createsuperuser", interactive=True) " evennia createsuperuser\n\n" \
"Follow the prompts, then restart the server."
raise Exception(txt)
return god_player return god_player