mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-02-08 15:22:27 +00:00
default safe mode for activity serialization
This commit is contained in:
parent
4d0e52bf51
commit
fba53c72e0
2 changed files with 2 additions and 3 deletions
|
@ -9,7 +9,7 @@ class ActivitypubResponse(JsonResponse):
|
||||||
configures some stuff beforehand. Made to be a drop-in replacement of
|
configures some stuff beforehand. Made to be a drop-in replacement of
|
||||||
JsonResponse.
|
JsonResponse.
|
||||||
"""
|
"""
|
||||||
def __init__(self, data, encoder=ActivityEncoder, safe=True,
|
def __init__(self, data, encoder=ActivityEncoder, safe=False,
|
||||||
json_dumps_params=None, **kwargs):
|
json_dumps_params=None, **kwargs):
|
||||||
|
|
||||||
if 'content_type' not in kwargs:
|
if 'content_type' not in kwargs:
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
''' tagging views'''
|
''' tagging views'''
|
||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
from django.http import HttpResponseNotFound
|
|
||||||
from django.shortcuts import get_object_or_404, redirect
|
from django.shortcuts import get_object_or_404, redirect
|
||||||
from django.template.response import TemplateResponse
|
from django.template.response import TemplateResponse
|
||||||
from django.utils.decorators import method_decorator
|
from django.utils.decorators import method_decorator
|
||||||
|
@ -20,7 +19,7 @@ class Tag(View):
|
||||||
|
|
||||||
if is_api_request(request):
|
if is_api_request(request):
|
||||||
return ActivitypubResponse(
|
return ActivitypubResponse(
|
||||||
tag_obj.to_activity(**request.GET), safe=False)
|
tag_obj.to_activity(**request.GET))
|
||||||
|
|
||||||
books = models.Edition.objects.filter(
|
books = models.Edition.objects.filter(
|
||||||
usertag__tag__identifier=tag_id
|
usertag__tag__identifier=tag_id
|
||||||
|
|
Loading…
Reference in a new issue