settings().get(..) => settings().getBoolean(..)
This commit is contained in:
parent
3441431cdf
commit
ea53fd368a
3 changed files with 5 additions and 5 deletions
|
|
@ -44,7 +44,7 @@ def apiKeyRequestHandler():
|
|||
# ui api key => continue regular request processing
|
||||
return
|
||||
|
||||
if not settings().get(["api", "enabled"]):
|
||||
if not settings().getBoolean(["api", "enabled"]):
|
||||
# api disabled => 401
|
||||
return _flask.make_response("API disabled", 401)
|
||||
|
||||
|
|
@ -104,7 +104,7 @@ def optionsAllowOrigin(request):
|
|||
|
||||
|
||||
def get_user_for_apikey(apikey):
|
||||
if settings().get(["api", "enabled"]) and apikey is not None:
|
||||
if settings().getBoolean(["api", "enabled"]) and apikey is not None:
|
||||
if apikey == settings().get(["api", "key"]) or octoprint.server.appSessionManager.validate(apikey):
|
||||
# master key or an app session key was used
|
||||
return ApiUser()
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ def _get_flask_user_from_request(request):
|
|||
from octoprint.settings import settings
|
||||
|
||||
apikey = octoprint.server.util.get_api_key(request)
|
||||
if settings().get(["api", "enabled"]) and apikey is not None:
|
||||
if settings().getBoolean(["api", "enabled"]) and apikey is not None:
|
||||
user = octoprint.server.util.get_user_for_apikey(apikey)
|
||||
else:
|
||||
user = flask.ext.login.current_user
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ class MachineCom(object):
|
|||
return
|
||||
|
||||
if newState == self.STATE_CLOSED or newState == self.STATE_CLOSED_WITH_ERROR:
|
||||
if settings().get(["feature", "sdSupport"]):
|
||||
if settings().getBoolean(["feature", "sdSupport"]):
|
||||
self._sdFileList = False
|
||||
self._sdFiles = []
|
||||
self._callback.on_comm_sd_files([])
|
||||
|
|
@ -407,7 +407,7 @@ class MachineCom(object):
|
|||
self._serial.close()
|
||||
self._serial = None
|
||||
|
||||
if settings().get(["feature", "sdSupport"]):
|
||||
if settings().getBoolean(["feature", "sdSupport"]):
|
||||
self._sdFileList = []
|
||||
|
||||
if printing:
|
||||
|
|
|
|||
Loading…
Reference in a new issue