Fix README, turn exceptions to responses

This commit is contained in:
Kumi 2020-10-12 16:50:14 +02:00
parent b2e760053f
commit 12e6d64b37
2 changed files with 5 additions and 4 deletions

View file

@ -4,7 +4,8 @@
This application requires Python3 to be installed with all the packages listed in `requirements.txt`, as well as the following software:
* Perl and the erect2cubic package
* Perl and the erect2cubic package (Panotools::Script)
* Hugin (incl. Nona)
* Java and zxing
* PythonMagick
* PythonMagick
* zbar

View file

@ -53,14 +53,14 @@ class APICreateSeries(JsonView):
if id:
try:
Series.objects.get(id=id)
raise ValueError("Series object with id %s exists" % id)
return JsonResponse({"error": "Series object with id %s exists" % id})
except Series.DoesNotExist:
pass
if uuid:
try:
Series.objects.get(id=uuid)
raise ValueError("Series object with uuid %s exists" % uuid)
return JsonResponse({"error": "Series object with uuid %s exists" % uuid})
except Series.DoesNotExist:
pass