Merge pull request #733 from normanjaeckel/Fix_Syncdb

Disable interactive mode of the syncdb command, fixed #696
This commit is contained in:
Oskar Hahn 2013-06-16 02:31:27 -07:00
commit fd731d68fa

View File

@ -20,6 +20,15 @@ class Command(_Command):
Setup the database and sends the signal post_database_setup. Setup the database and sends the signal post_database_setup.
""" """
def handle_noargs(self, *args, **kwargs): def handle_noargs(self, *args, **kwargs):
return_value = super(Command, self).handle_noargs(*args, **kwargs) """
Calls Django's syncdb command but always in non-interactive mode. After
this it sends our post_database_setup signal.
"""
interactive = kwargs.pop('interactive')
return_value = super(Command, self).handle_noargs(*args, interactive=False, **kwargs)
post_database_setup.send(sender=self) post_database_setup.send(sender=self)
if interactive:
print('Interactive mode (e. g. creating a superuser) is not possibile '
'via this command. To create a superuser use the --reset-admin '
'option of the main script.')
return return_value return return_value