Finalement on dirait qu'on a besoin des pauses
This commit is contained in:
parent
bc09f4b50c
commit
435aea248e
38
src/agenda_culturel/migrations/0145_revert_pause.py
Normal file
38
src/agenda_culturel/migrations/0145_revert_pause.py
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
# Generated by Django 4.2.9 on 2025-02-04 00:12
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
def fb_pause(apps, schema_editor):
|
||||||
|
RecurrentImport = apps.get_model("agenda_culturel", "RecurrentImport")
|
||||||
|
|
||||||
|
rimports = RecurrentImport.objects.filter(processor="Facebook events").all()
|
||||||
|
|
||||||
|
for r in rimports:
|
||||||
|
r.downloader = "chromium (pause)"
|
||||||
|
|
||||||
|
RecurrentImport.objects.bulk_update(rimports, fields=["downloader"])
|
||||||
|
|
||||||
|
def fb_pause_backward(apps, schema_editor):
|
||||||
|
RecurrentImport = apps.get_model("agenda_culturel", "RecurrentImport")
|
||||||
|
|
||||||
|
rimports = RecurrentImport.objects.filter(processor="Facebook events").all()
|
||||||
|
|
||||||
|
for r in rimports:
|
||||||
|
r.downloader = "chromium headless"
|
||||||
|
|
||||||
|
RecurrentImport.objects.bulk_update(rimports, fields=["downloader"])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('agenda_culturel', '0144_event_agenda_cult_recurre_5c5094_idx'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RunPython(
|
||||||
|
fb_pause,
|
||||||
|
fb_pause_backward,
|
||||||
|
),
|
||||||
|
]
|
Loading…
x
Reference in New Issue
Block a user