Skip to content

Commit

Permalink
yeah
Browse files Browse the repository at this point in the history
  • Loading branch information
jaesivsm committed Mar 12, 2017
1 parent 1487e4b commit a7d8231
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion install.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def install_python_deps(args):
conf, 'SQLALCHEMY_DATABASE_URI', '')

print('installing python dependencies...')
base_cmd = ['install', '--quiet', '-r']
base_cmd = ['install', '--quiet', '--upgrade', '-r']
pip.main(base_cmd + ['requirements.txt'])
if install_postgres:
pip.main(base_cmd + ['requirements.postgres.txt'])
Expand Down
3 changes: 3 additions & 0 deletions src/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import requests
from flask import request, url_for
from werkzeug.exceptions import HTTPException

from bootstrap import conf

Expand Down Expand Up @@ -38,6 +39,8 @@ def default_handler(obj, role='admin'):
return obj.dump(role=role)
if isinstance(obj, (set, frozenset, filter, types.GeneratorType)):
return list(obj)
if isinstance(obj, HTTPException):
return "%d: %s" % (obj.code, obj.name)
if isinstance(obj, BaseException):
return str(obj)
raise TypeError("Object of type %s with value of %r "
Expand Down
4 changes: 2 additions & 2 deletions src/web/views/api/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class Proxy:
results.append(obj)
except Exception as error:
fail_count += 1
results.append(str(error))
results.append(error)
if fail_count == len(results): # all failed => 500
status = 500
elif fail_count: # some failed => 206
Expand All @@ -215,7 +215,7 @@ class Proxy:
else:
results.append('nok')
except Exception as error:
results.append(str(error))
results.append(error)
if results.count('ok') == 0: # all failed => 500
status = 500
elif results.count('ok') != len(results): # some failed => 206
Expand Down

0 comments on commit a7d8231

Please sign in to comment.