mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 03:41:58 +00:00
Rework management commands to handle deployment assignment
We now ensure `create_realm` adds you to a default deployment and that `create_deployment` removes the old deployment association when performed. (imported from commit 5b94fb07b8e11332765b057dc640a5ed873ec99e)
This commit is contained in:
@@ -41,6 +41,10 @@ class Command(BaseCommand):
|
||||
dep = Deployment()
|
||||
dep.api_key = random_api_key()
|
||||
dep.save()
|
||||
old_dep = realm.deployment
|
||||
if old_dep is not None:
|
||||
old_dep.realms.remove(realm)
|
||||
old_dep.save()
|
||||
dep.realms = [realm]
|
||||
dep.save()
|
||||
print "Deployment created."
|
||||
|
||||
Reference in New Issue
Block a user