Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

migrations: Lazily import zerver.lib.streams from 0206.

Anders Kaseorg1682a6a50d35
diff --git a/zerver/migrations/0206_stream_rendered_description.py b/zerver/migrations/0206_stream_rendered_description.py
index fb2c8c9d2b7..38f58e43b63 100644
--- a/zerver/migrations/0206_stream_rendered_description.py
+++ b/zerver/migrations/0206_stream_rendered_description.py
@@ -2,10 +2,11 @@ from django.db import migrations, models
from django.db.backends.postgresql.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
-from zerver.lib.streams import render_stream_description
-
def render_all_stream_descriptions(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
+ # FIXME: Application code should not be imported from migrations.
+ from zerver.lib.streams import render_stream_description
+
Stream = apps.get_model("zerver", "Stream")
all_streams = Stream.objects.exclude(description="")
for stream in all_streams: