mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 14:39:16 +02:00
Attribute artist
This commit is contained in:
parent
8687a64873
commit
4e44e4e4b6
31 changed files with 1741 additions and 46 deletions
|
@ -57,7 +57,9 @@ def insert_context(ctx, doc):
|
|||
existing = doc["@context"]
|
||||
if isinstance(existing, list):
|
||||
if ctx not in existing:
|
||||
existing = existing[:]
|
||||
existing.append(ctx)
|
||||
doc["@context"] = existing
|
||||
else:
|
||||
doc["@context"] = [existing, ctx]
|
||||
return doc
|
||||
|
@ -215,6 +217,15 @@ def get_default_context():
|
|||
return ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1", {}]
|
||||
|
||||
|
||||
def get_default_context_fw():
|
||||
return [
|
||||
"https://www.w3.org/ns/activitystreams",
|
||||
"https://w3id.org/security/v1",
|
||||
{},
|
||||
"https://funkwhale.audio/ns",
|
||||
]
|
||||
|
||||
|
||||
class JsonLdSerializer(serializers.Serializer):
|
||||
def run_validation(self, data=empty):
|
||||
if data and data is not empty and self.context.get("expand", True):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue