22 lines
489 B
Python
22 lines
489 B
Python
# Generated by Django 3.1.7 on 2021-03-29 15:00
|
|
|
|
from django.db import migrations, models
|
|
from ..models import Session
|
|
|
|
|
|
def update_bounce_stats(_a, _b):
|
|
Session.objects.all().annotate(hit_count=models.Count("hit")).filter(
|
|
hit_count__gt=1
|
|
).update(is_bounce=False)
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
("analytics", "0008_session_is_bounce"),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(update_bounce_stats, lambda: ()),
|
|
]
|