Model / settings for allow-listing

This commit is contained in:
Eliot Berriot 2019-06-17 08:48:05 +02:00
parent 1a52dfcc1d
commit 2b2b64f0a7
8 changed files with 90 additions and 1 deletions

View file

@ -26,7 +26,8 @@ redeliver_activities.short_description = "Redeliver"
@admin.register(models.Domain)
class DomainAdmin(admin.ModelAdmin):
list_display = ["name", "creation_date"]
list_display = ["name", "allowed", "creation_date"]
list_filter = ["allowed"]
search_fields = ["name"]

View file

@ -0,0 +1,19 @@
# Generated by Django 2.2.2 on 2019-06-11 08:51
import django.contrib.postgres.fields.jsonb
import django.core.serializers.json
from django.db import migrations, models
import funkwhale_api.federation.models
class Migration(migrations.Migration):
dependencies = [("federation", "0018_fetch")]
operations = [
migrations.AddField(
model_name="domain",
name="allowed",
field=models.BooleanField(default=None, null=True),
)
]

View file

@ -118,6 +118,9 @@ class Domain(models.Model):
null=True,
blank=True,
)
# are interactions with this domain allowed (only applies when allow-listing is on)
allowed = models.BooleanField(default=None, null=True)
objects = DomainQuerySet.as_manager()
def __str__(self):