From 2b52eec41f5278428aa78735042258b6503bd408 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Fri, 26 Jun 2020 11:05:01 +0300 Subject: [PATCH] Allow chunk UIDs to be longer. --- .../migrations/0019_auto_20200626_0748.py | 19 +++++++++++++++++++ django_etebase/models.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 django_etebase/migrations/0019_auto_20200626_0748.py diff --git a/django_etebase/migrations/0019_auto_20200626_0748.py b/django_etebase/migrations/0019_auto_20200626_0748.py new file mode 100644 index 0000000..991ca50 --- /dev/null +++ b/django_etebase/migrations/0019_auto_20200626_0748.py @@ -0,0 +1,19 @@ +# Generated by Django 3.0.3 on 2020-06-26 07:48 + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('django_etebase', '0018_auto_20200624_0748'), + ] + + operations = [ + migrations.AlterField( + model_name='collectionitemchunk', + name='uid', + field=models.CharField(db_index=True, max_length=60, validators=[django.core.validators.RegexValidator(message='Not a valid UID', regex='^[a-zA-Z0-9\\-_]*$')]), + ), + ] diff --git a/django_etebase/models.py b/django_etebase/models.py index 5f7a6f2..964012a 100644 --- a/django_etebase/models.py +++ b/django_etebase/models.py @@ -89,7 +89,7 @@ def chunk_directory_path(instance, filename): class CollectionItemChunk(models.Model): uid = models.CharField(db_index=True, blank=False, null=False, - max_length=43, validators=[Base64Url256BitlValidator]) + max_length=60, validators=[UidValidator]) item = models.ForeignKey(CollectionItem, related_name='chunks', on_delete=models.CASCADE) chunkFile = models.FileField(upload_to=chunk_directory_path, max_length=150, unique=True)