Hi I was able to fix the issue. When the request to create a network in a non-existant site is sent, the perform_create method in class NsotViewSet gets called. The line with objects = serializer.save() throws an exc.ObjectDoesNotExist exception because of the non-existant site. This exception is not handled and causes an internal server error, hence the 500 status code error and stacktrace. To fix the issue,I catch the exc.ObjectDoesNotExist exception and raise a BadRequest exception instead which has the 400 status code. This status code was requested by @jathanism in issue #219.
Also, I am adding a description variable with a string value assigned in the BuildStatic class. Whenever you run python setup.py --help-commands you would see "(no description available)" next to the build_static option, which can be seen below.
With my changes you would see a description for build_static when you run python setup.py --help-commands, which can be see below
The new description will be "builds all front end dependencies"
Hi I was able to fix the issue. When the request to create a network in a non-existant site is sent, the
perform_create
method in classNsotViewSet
gets called. The line withobjects = serializer.save()
throws anexc.ObjectDoesNotExist
exception because of the non-existant site. This exception is not handled and causes an internal server error, hence the 500 status code error and stacktrace. To fix the issue,I catch theexc.ObjectDoesNotExist
exception and raise a BadRequest exception instead which has the 400 status code. This status code was requested by @jathanism in issue #219.Also, I am adding a description variable with a string value assigned in the BuildStatic class. Whenever you run python setup.py --help-commands you would see "(no description available)" next to the build_static option, which can be seen below.
With my changes you would see a description for build_static when you run python setup.py --help-commands, which can be see below
The new description will be "builds all front end dependencies"