Skip to content

Commit

Permalink
solve an exception that occurs when no field is in swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
PengfeiLi0218 committed Jan 4, 2019
1 parent 9183f0a commit 818a3e4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apitester/runtests/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ def get_post_or_update(self, method, testconfigs, testconfig_pk, path, data, swa
if field in field_names:
request_body[field] = getattr(testconfigs["selected"], field)
else:
request_body[field] = params["properties"][field].get("example", "")
try:
request_body[field] = params["properties"][field].get("example", "")
except:
request_body[field] = None
params = json.dumps(request_body, indent=4)

return [{
Expand Down

0 comments on commit 818a3e4

Please sign in to comment.