Commit 8fbf7fe1 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

added excluded commands to management

parent 7fffe4e9
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -17,6 +17,18 @@ class ManagementUtility(management.ManagementUtility):
			);
			sys.exit(1)

		excluded_cmds = getattr(settings, 'EXCLUDED_COMMANDS')
		if excluded_cmds and subcommand in excluded_cmds:
			class DummyCommand(Command):
				def run(self, **opts):
					sys.stderr.write(
						"running '{0}' is disallowed by the package "
						"configuration.\n"
						.format(subcommand)
					);
					sys.exit(1)
			return DummyCommand()

		class RunserverCommand(Command):
			def run(self, **options):
				if not hasattr(settings, 'SITE_URL'):
+5 −0
Original line number Diff line number Diff line
@@ -6,4 +6,9 @@
#

from . import *

EXCLUDED_COMMANDS = [
	'startproject', 'startapp', 'makemigrations',
]

load_site(globals(), '/etc/kodo-sso/conf.d/*')