From c695e76a57490d5619b80159b20751eebe699333 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 31 Oct 2011 16:06:12 +0000 Subject: [PATCH] return 409 on conflict --- pandora/event/views.py | 4 ++-- pandora/place/views.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pandora/event/views.py b/pandora/event/views.py index 5148a4928..f1436ca54 100644 --- a/pandora/event/views.py +++ b/pandora/event/views.py @@ -47,7 +47,7 @@ def addEvent(request): response = json_response(status=200, text='created') response['data'] = event.json() else: - response = json_response(status=403, text='name exists') + response = json_response(status=409, text='name exists') response['data']['names'] = existing_names return render_to_json_response(response) actions.register(addEvent, cache=False) @@ -92,7 +92,7 @@ def editEvent(request): response = json_response(status=200, text='updated') response['data'] = event.json() else: - response = json_response(status=403, text='Event name conflict') + response = json_response(status=409, text='Event name conflict') response['data']['names'] = conflict_names else: response = json_response(status=403, text='permission denied') diff --git a/pandora/place/views.py b/pandora/place/views.py index a33752181..1f08c6275 100644 --- a/pandora/place/views.py +++ b/pandora/place/views.py @@ -62,7 +62,7 @@ def addPlace(request): tasks.update_matches.delay(place.id) response = json_response(place.json()) else: - response = json_response(status=403, + response = json_response(status=409, text='%s exists'%(existing_names and 'Name' or 'Geoname')) response['data']['names'] = existing_names if existing_geoname: @@ -110,7 +110,7 @@ def editPlace(request): tasks.update_matches.delay(place.id) response = json_response(place.json()) else: - response = json_response(status=403, + response = json_response(status=409, text='%s exists'%(conflict_names and 'Name' or 'Geoname')) response['data']['names'] = conflict_names if conflict_geoname: