3👍
you can do that this way:
from tastypie.exceptions import ImmediateHttpResponse
from tastypie.http import HttpBadRequest
if test_fails:
raise ImmediateHttpResponse(HttpBadRequest("User already exists"))
Source:stackexchange.com
3👍
you can do that this way:
from tastypie.exceptions import ImmediateHttpResponse
from tastypie.http import HttpBadRequest
if test_fails:
raise ImmediateHttpResponse(HttpBadRequest("User already exists"))