Merge pull request #1415 from whummer/fix/404-on-missing-action
Return 404 error on missing action
This commit is contained in:
commit
e85bbe2ebc
2 changed files with 5 additions and 0 deletions
|
|
@ -272,6 +272,9 @@ class BaseResponse(_TemplateEnvironmentMixin):
|
||||||
headers['status'] = str(headers['status'])
|
headers['status'] = str(headers['status'])
|
||||||
return status, headers, body
|
return status, headers, body
|
||||||
|
|
||||||
|
if not action:
|
||||||
|
return 404, headers, ''
|
||||||
|
|
||||||
raise NotImplementedError(
|
raise NotImplementedError(
|
||||||
"The {0} action has not been implemented".format(action))
|
"The {0} action has not been implemented".format(action))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@ def camelcase_to_underscores(argument):
|
||||||
python underscore variable like the_new_attribute'''
|
python underscore variable like the_new_attribute'''
|
||||||
result = ''
|
result = ''
|
||||||
prev_char_title = True
|
prev_char_title = True
|
||||||
|
if not argument:
|
||||||
|
return argument
|
||||||
for index, char in enumerate(argument):
|
for index, char in enumerate(argument):
|
||||||
try:
|
try:
|
||||||
next_char_title = argument[index + 1].istitle()
|
next_char_title = argument[index + 1].istitle()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue