Using assert statements is not encourged in production, because they will get stripped out of .pyo files and not run. Instead, we should raise RuntimeError.
rebased
To keep it equivalent this should be: if result != 1
if result != 1
Rebased to address the comment.
Looks good here.
I dunno - do you want to return a response tuple with an explicit error code. Maybe 503? The exception here generating a 500 works just as well. :+1:
Yeah, that reminds to return the errors in JSON and this error will be handled properly there.
:+1:
Pull-Request has been merged by ralph
Using assert statements is not encourged in production, because they
will get stripped out of .pyo files and not run. Instead, we should
raise RuntimeError.