mirror of https://github.com/zulip/zulip.git
unarchive_stream: Prevent unarchiving a stream in the wrong realm.
This commit is contained in:
parent
01b59c5aa2
commit
d834f1fc01
|
@ -43,6 +43,10 @@ class Command(ZulipBaseCommand):
|
|||
|
||||
if options["stream_id"] is not None:
|
||||
stream = Stream.objects.get(id=options["stream_id"])
|
||||
if stream.realm_id != realm.id:
|
||||
raise CommandError(
|
||||
f"Stream id {stream.id}, named '{stream.name}', is in realm '{stream.realm.string_id}', not '{realm.string_id}'"
|
||||
)
|
||||
if not stream.deactivated:
|
||||
raise CommandError(
|
||||
f"Stream id {stream.id}, named '{stream.name}', is not deactivated"
|
||||
|
|
Loading…
Reference in New Issue