mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 00:49:16 +02:00
Attribute artist
This commit is contained in:
parent
8687a64873
commit
4e44e4e4b6
31 changed files with 1741 additions and 46 deletions
|
@ -1,14 +1,15 @@
|
|||
from funkwhale_api.common import mutations
|
||||
from funkwhale_api.federation import routes
|
||||
|
||||
from . import models
|
||||
|
||||
|
||||
def can_suggest(obj, actor):
|
||||
return True
|
||||
return obj.is_local
|
||||
|
||||
|
||||
def can_approve(obj, actor):
|
||||
return actor.user and actor.user.get_permissions()["library"]
|
||||
return obj.is_local and actor.user and actor.user.get_permissions()["library"]
|
||||
|
||||
|
||||
@mutations.registry.connect(
|
||||
|
@ -22,3 +23,8 @@ class TrackMutationSerializer(mutations.UpdateMutationSerializer):
|
|||
class Meta:
|
||||
model = models.Track
|
||||
fields = ["license", "title", "position", "copyright"]
|
||||
|
||||
def post_apply(self, obj, validated_data):
|
||||
routes.outbox.dispatch(
|
||||
{"type": "Update", "object": {"type": "Track"}}, context={"track": obj}
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue