Verified Commit 1f3f790f authored by Eliot Berriot's avatar Eliot Berriot 💬

Fix #819: Fixed invalid required fields in Upload django's admin

parent d9d96a85
Pipeline #4104 passed with stages
in 3 minutes and 59 seconds
......@@ -325,7 +325,9 @@ class Fetch(models.Model):
)
object = GenericForeignKey("object_content_type", "object_id")
status = models.CharField(default="pending", choices=FETCH_STATUSES, max_length=20)
detail = JSONField(default=empty_dict, max_length=50000, encoder=DjangoJSONEncoder)
detail = JSONField(
default=empty_dict, max_length=50000, encoder=DjangoJSONEncoder, blank=True
)
actor = models.ForeignKey(Actor, related_name="fetches", on_delete=models.CASCADE)
objects = FetchQuerySet.as_manager()
......@@ -390,7 +392,9 @@ class Activity(models.Model):
uuid = models.UUIDField(default=uuid.uuid4, unique=True)
fid = models.URLField(unique=True, max_length=500, null=True, blank=True)
url = models.URLField(max_length=500, null=True, blank=True)
payload = JSONField(default=empty_dict, max_length=50000, encoder=DjangoJSONEncoder)
payload = JSONField(
default=empty_dict, max_length=50000, encoder=DjangoJSONEncoder, blank=True
)
creation_date = models.DateTimeField(default=timezone.now, db_index=True)
type = models.CharField(db_index=True, null=True, max_length=100)
......@@ -506,7 +510,7 @@ class LibraryTrack(models.Model):
album_title = models.CharField(max_length=500)
title = models.CharField(max_length=500)
metadata = JSONField(
default=empty_dict, max_length=10000, encoder=DjangoJSONEncoder
default=empty_dict, max_length=10000, encoder=DjangoJSONEncoder, blank=True
)
@property
......
......@@ -642,12 +642,12 @@ class Upload(models.Model):
# metadata from federation
metadata = JSONField(
default=empty_dict, max_length=50000, encoder=DjangoJSONEncoder
default=empty_dict, max_length=50000, encoder=DjangoJSONEncoder, blank=True
)
import_date = models.DateTimeField(null=True, blank=True)
# optionnal metadata provided during import
import_metadata = JSONField(
default=empty_dict, max_length=50000, encoder=DjangoJSONEncoder
default=empty_dict, max_length=50000, encoder=DjangoJSONEncoder, blank=True
)
# status / error details for the import
import_status = models.CharField(
......@@ -659,10 +659,10 @@ class Upload(models.Model):
# optionnal metadata about import results (error messages, etc.)
import_details = JSONField(
default=empty_dict, max_length=50000, encoder=DjangoJSONEncoder
default=empty_dict, max_length=50000, encoder=DjangoJSONEncoder, blank=True
)
from_activity = models.ForeignKey(
"federation.Activity", null=True, on_delete=models.SET_NULL
"federation.Activity", null=True, on_delete=models.SET_NULL, blank=True
)
objects = UploadQuerySet.as_manager()
......
Fixed invalid required fields in Upload django's admin (#819)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment