mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 11:19:15 +02:00
See #170: reel2bits compat
This commit is contained in:
parent
1d37a2c819
commit
9e8983bb60
13 changed files with 248 additions and 53 deletions
|
@ -1,3 +1,4 @@
|
|||
from rest_framework.negotiation import BaseContentNegotiation
|
||||
from rest_framework.renderers import JSONRenderer
|
||||
|
||||
|
||||
|
@ -15,5 +16,19 @@ def get_ap_renderers():
|
|||
]
|
||||
|
||||
|
||||
class IgnoreClientContentNegotiation(BaseContentNegotiation):
|
||||
def select_parser(self, request, parsers):
|
||||
"""
|
||||
Select the first parser in the `.parser_classes` list.
|
||||
"""
|
||||
return parsers[0]
|
||||
|
||||
def select_renderer(self, request, renderers, format_suffix):
|
||||
"""
|
||||
Select the first renderer in the `.renderer_classes` list.
|
||||
"""
|
||||
return (renderers[0], renderers[0].media_type)
|
||||
|
||||
|
||||
class WebfingerRenderer(JSONRenderer):
|
||||
media_type = "application/jrd+json"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue