mirror of
https://github.com/ajurna/cbwebreader.git
synced 2025-12-06 14:17:19 +00:00
massive change on how files are accessed.
moved from prviding a path to using unique id's if there might have been any directory traversal issues they should be gone now.
This commit is contained in:
29
comic/migrations/0009_auto_20160331_1140.py
Normal file
29
comic/migrations/0009_auto_20160331_1140.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.9.2 on 2016-03-31 10:40
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
import uuid
|
||||
|
||||
|
||||
def gen_uuid(apps, schema_editor):
|
||||
comicbook = apps.get_model('comic', 'comicbook')
|
||||
for row in comicbook.objects.all():
|
||||
row.selector = uuid.uuid4()
|
||||
row.save()
|
||||
directory = apps.get_model('comic', 'directory')
|
||||
for row in directory.objects.all():
|
||||
row.selector = uuid.uuid4()
|
||||
row.save()
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('comic', '0008_auto_20160331_1140'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(gen_uuid, reverse_code=migrations.RunPython.noop),
|
||||
]
|
||||
Reference in New Issue
Block a user