2020-06-14 23:36:14 +02:00
|
|
|
# Generated by Django 2.2.13 on 2020-06-14 01:58
|
|
|
|
|
|
|
|
from django.db import migrations
|
2023-03-04 01:40:40 +01:00
|
|
|
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
|
2020-06-14 23:36:14 +02:00
|
|
|
from django.db.migrations.state import StateApps
|
|
|
|
|
|
|
|
VIDEO_CHAT_PROVIDERS = {
|
2021-02-12 08:20:45 +01:00
|
|
|
"jitsi_meet": {
|
|
|
|
"name": "Jitsi Meet",
|
|
|
|
"id": 1,
|
2020-06-14 23:36:14 +02:00
|
|
|
},
|
2021-02-12 08:20:45 +01:00
|
|
|
"google_hangouts": {
|
|
|
|
"name": "Google Hangouts",
|
|
|
|
"id": 2,
|
2020-06-14 23:36:14 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2021-02-12 08:19:30 +01:00
|
|
|
|
2022-05-27 23:33:51 +02:00
|
|
|
def remove_google_hangouts_provider(
|
|
|
|
apps: StateApps, schema_editor: BaseDatabaseSchemaEditor
|
|
|
|
) -> None:
|
2020-06-14 23:36:14 +02:00
|
|
|
# We are removing the Google Hangout integration because Google has
|
|
|
|
# removed the Hangouts brand. All the realms that used Hangouts as
|
2020-08-11 01:47:54 +02:00
|
|
|
# their video chat provided are now set to the default, Jitsi.
|
2021-02-12 08:20:45 +01:00
|
|
|
Realm = apps.get_model("zerver", "Realm")
|
|
|
|
Realm.objects.filter(video_chat_provider=VIDEO_CHAT_PROVIDERS["google_hangouts"]["id"]).update(
|
|
|
|
video_chat_provider=VIDEO_CHAT_PROVIDERS["jitsi_meet"]["id"]
|
2020-06-14 23:36:14 +02:00
|
|
|
)
|
|
|
|
|
2021-02-12 08:19:30 +01:00
|
|
|
|
2020-06-14 23:36:14 +02:00
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
2021-02-12 08:20:45 +01:00
|
|
|
("zerver", "0284_convert_realm_admins_to_realm_owners"),
|
2020-06-14 23:36:14 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.RemoveField(
|
2021-02-12 08:20:45 +01:00
|
|
|
model_name="realm",
|
|
|
|
name="google_hangouts_domain",
|
2020-06-14 23:36:14 +02:00
|
|
|
),
|
|
|
|
migrations.RunPython(
|
2021-02-12 08:19:30 +01:00
|
|
|
remove_google_hangouts_provider, reverse_code=migrations.RunPython.noop, elidable=True
|
2020-06-14 23:36:14 +02:00
|
|
|
),
|
|
|
|
]
|