Coverage for app/venv/lib/python3.14/site-packages/weblate/accounts/migrations/0002_new_string_notification.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.15.2, created at 2026-10-07 07:15 +0000

1# Copyright © Michal Čihař <michal@weblate.org> 

2# 

3# SPDX-License-Identifier: GPL-3.0-or-later 

4 

5# Generated by Django 4.2.5 on 2023-10-12 08:25 

6 

7from django.db import migrations 

8 

9 

10def migrate_subscription(apps, schema_editor) -> None: 

11 Subscription = apps.get_model("accounts", "Subscription") 

12 # Change instant to daily, because this now has string granularity 

13 Subscription.objects.filter( 

14 notification="NewStringNotificaton", frequency=1 

15 ).update(frequency=2) 

16 

17 

18class Migration(migrations.Migration): 

19 dependencies = [ 

20 ("accounts", "0001_squashed_weblate_5"), 

21 ("trans", "0006_alter_change_action"), 

22 ] 

23 

24 operations = [ 

25 migrations.RunPython( 

26 migrate_subscription, migrations.RunPython.noop, elidable=True 

27 ), 

28 ]