kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
Remove usage of deprecated Model and Serializer fields (#1663)
rodzic
b53ced6ac9
commit
252ebf8ce7
|
@ -381,6 +381,9 @@ MIGRATION_MODULES = {
|
|||
"sites": "funkwhale_api.contrib.sites.migrations",
|
||||
}
|
||||
|
||||
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
|
||||
# see https://docs.djangoproject.com/en/4.0/releases/3.2/
|
||||
|
||||
# GENERAL CONFIGURATION
|
||||
# ------------------------------------------------------------------------------
|
||||
# Local time zone for this installation. Choices can be found here:
|
||||
|
|
|
@ -2,7 +2,7 @@ import uuid
|
|||
|
||||
|
||||
from django.contrib.contenttypes.fields import GenericRelation
|
||||
from django.contrib.postgres.fields import JSONField
|
||||
from django.db.models import JSONField
|
||||
from django.core.serializers.json import DjangoJSONEncoder
|
||||
from django.db import models
|
||||
from django.urls import reverse
|
||||
|
|
|
@ -2,7 +2,7 @@ import uuid
|
|||
import magic
|
||||
import mimetypes
|
||||
|
||||
from django.contrib.postgres.fields import JSONField
|
||||
from django.db.models import JSONField
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.conf import settings
|
||||
|
@ -116,10 +116,10 @@ class Mutation(models.Model):
|
|||
|
||||
type = models.CharField(max_length=100, db_index=True)
|
||||
# None = no choice, True = approved, False = refused
|
||||
is_approved = models.NullBooleanField(default=None)
|
||||
is_approved = models.BooleanField(default=None, null=True)
|
||||
|
||||
# None = not applied, True = applied, False = failed
|
||||
is_applied = models.NullBooleanField(default=None)
|
||||
is_applied = models.BooleanField(default=None, null=True)
|
||||
creation_date = models.DateTimeField(default=timezone.now, db_index=True)
|
||||
applied_date = models.DateTimeField(null=True, blank=True, db_index=True)
|
||||
summary = models.TextField(max_length=2000, null=True, blank=True)
|
||||
|
|
|
@ -3,7 +3,7 @@ import urllib.parse
|
|||
import uuid
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.postgres.fields import JSONField
|
||||
from django.db.models import JSONField
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
|
@ -198,7 +198,7 @@ class Actor(models.Model):
|
|||
private_key = models.TextField(max_length=5000, null=True, blank=True)
|
||||
creation_date = models.DateTimeField(default=timezone.now)
|
||||
last_fetch_date = models.DateTimeField(default=timezone.now)
|
||||
manually_approves_followers = models.NullBooleanField(default=None)
|
||||
manually_approves_followers = models.BooleanField(default=None, null=True)
|
||||
followers = models.ManyToManyField(
|
||||
to="self",
|
||||
symmetrical=False,
|
||||
|
@ -488,7 +488,7 @@ class AbstractFollow(models.Model):
|
|||
uuid = models.UUIDField(default=uuid.uuid4, unique=True)
|
||||
creation_date = models.DateTimeField(default=timezone.now)
|
||||
modification_date = models.DateTimeField(auto_now=True)
|
||||
approved = models.NullBooleanField(default=None)
|
||||
approved = models.BooleanField(default=None, null=True)
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
|
|
@ -237,7 +237,9 @@ class ActorSerializer(jsonld.JsonLdSerializer):
|
|||
choices=[getattr(contexts.AS, c[0]) for c in models.TYPE_CHOICES]
|
||||
)
|
||||
preferredUsername = serializers.CharField()
|
||||
manuallyApprovesFollowers = serializers.NullBooleanField(required=False)
|
||||
manuallyApprovesFollowers = serializers.BooleanField(
|
||||
required=False, allow_null=True
|
||||
)
|
||||
name = serializers.CharField(
|
||||
required=False, max_length=200, allow_blank=True, allow_null=True
|
||||
)
|
||||
|
|
|
@ -3,7 +3,7 @@ import uuid
|
|||
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.contrib.postgres.fields import JSONField
|
||||
from django.db.models import JSONField
|
||||
from django.db import models
|
||||
from django.db.models.signals import pre_save
|
||||
from django.dispatch import receiver
|
||||
|
|
|
@ -12,7 +12,7 @@ import arrow
|
|||
import pydub
|
||||
from django.conf import settings
|
||||
from django.contrib.contenttypes.fields import GenericRelation
|
||||
from django.contrib.postgres.fields import JSONField
|
||||
from django.db.models import JSONField
|
||||
from django.contrib.postgres.search import SearchVectorField
|
||||
from django.contrib.postgres.indexes import GinIndex
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.contrib.postgres.fields import JSONField
|
||||
from django.db.models import JSONField
|
||||
from django.core.serializers.json import DjangoJSONEncoder
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
|
|
|
@ -9,7 +9,7 @@ import uuid
|
|||
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import AbstractUser, UserManager as BaseUserManager
|
||||
from django.contrib.postgres.fields import JSONField
|
||||
from django.db.models import JSONField
|
||||
from django.db import models, transaction
|
||||
from django.dispatch import receiver
|
||||
from django.urls import reverse
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Remove usage of deprecated Model and Serializer fields (#1663)
|
Ładowanie…
Reference in New Issue