Coverage for seedboxsync/core/database/migrations/0008_torrent_source.py: 78%

9 statements  

« prev     ^ index     » next       coverage.py v7.16.1, created at 2026-09-26 17:14 +0000

1# Generated from a schema diff on 2026-09-25 22:07. 

2# ruff: noqa: ANN001, ANN201, D100, D103, F403 

3# type: ignore 

4from flask import current_app 

5from peewee import * 

6from seedboxsync.core.database.models import Torrent 

7 

8 

9def up(migrator, db): 

10 with current_app.app_context(): 

11 torrents = Torrent.select().where((Torrent.source == "") | (Torrent.source.is_null())) 

12 for torrent in torrents: 

13 torrent.source = torrent.announcer 

14 torrent.save()