TandoorRecipes/cookbook/migrations/0056_auto_20200625_2157.py
vabene1111 6979bf34d9 fixed insecure uuid defaults
due to some unexpected behavior the share link uuid values were not random. All already created share links were disabled.
2020-06-25 22:01:54 +02:00

26 lines
592 B
Python

# Generated by Django 3.0.7 on 2020-06-25 19:57
from django.db import migrations, models
import uuid
def invalidate_shares(apps, schema_editor):
ShareLink = apps.get_model('cookbook', 'ShareLink')
ShareLink.objects.all().delete()
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0055_auto_20200616_1236'),
]
operations = [
migrations.AlterField(
model_name='sharelink',
name='uuid',
field=models.UUIDField(default=uuid.uuid4),
),
migrations.RunPython(invalidate_shares)
]