Fix #207: Consistent constraints/checks for URL size

This commit is contained in:
Eliot Berriot 2018-05-21 19:04:28 +02:00
parent 86211dc515
commit ae00cccf14
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
4 changed files with 67 additions and 38 deletions

View file

@ -139,7 +139,7 @@ class Library(models.Model):
on_delete=models.CASCADE,
related_name='library')
uuid = models.UUIDField(default=uuid.uuid4)
url = models.URLField()
url = models.URLField(max_length=500)
# use this flag to disable federation with a library
federation_enabled = models.BooleanField()
@ -166,8 +166,8 @@ def get_file_path(instance, filename):
class LibraryTrack(models.Model):
url = models.URLField(unique=True)
audio_url = models.URLField()
url = models.URLField(unique=True, max_length=500)
audio_url = models.URLField(max_length=500)
audio_mimetype = models.CharField(max_length=200)
audio_file = models.FileField(
upload_to=get_file_path,