Fix map/id/geojson content_type
This commit is contained in:
parent
915a407451
commit
408bbd81aa
3 changed files with 3 additions and 2 deletions
|
@ -6,7 +6,6 @@ from django.conf import settings
|
|||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.core.signing import Signer
|
||||
from django.contrib import messages
|
||||
from django.template.defaultfilters import slugify
|
||||
from django.core.files.base import File
|
||||
|
||||
|
|
|
@ -264,6 +264,7 @@ def test_map_geojson_view(client, map):
|
|||
url = reverse('map_geojson', args=(map.pk, ))
|
||||
response = client.get(url)
|
||||
j = json.loads(response.content.decode())
|
||||
assert 'json' in response['content-type']
|
||||
assert 'type' in j
|
||||
|
||||
|
||||
|
|
|
@ -486,7 +486,8 @@ class MapViewGeoJSON(MapView):
|
|||
return reverse('map_geojson', args=(self.object.pk, ))
|
||||
|
||||
def render_to_response(self, context, *args, **kwargs):
|
||||
return HttpResponse(context['map_settings'])
|
||||
return HttpResponse(context['map_settings'],
|
||||
content_type='application/json')
|
||||
|
||||
|
||||
class MapNew(MapDetailMixin, TemplateView):
|
||||
|
|
Loading…
Reference in a new issue