[bugfix] Controller: Fix response handling in setOscIpAddress method.
This commit is contained in:
1 parent
3d53652b2d
commit
df344baa06
1 file changed
+4
-3
@@ -1086,7 +1086,7 @@ class Controller:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def setOscIpAddress(data, *args, **kwargs) -> dict:
|
def setOscIpAddress(data, *args, **kwargs) -> dict:
|
||||||
if isValidIpAddress(data) is False:
|
if isValidIpAddress(data) is False:
|
||||||
return {
|
response = {
|
||||||
"status":400,
|
"status":400,
|
||||||
"result":{
|
"result":{
|
||||||
"message":"Invalid IP address",
|
"message":"Invalid IP address",
|
||||||
@@ -1097,16 +1097,17 @@ class Controller:
|
|||||||
try:
|
try:
|
||||||
model.setOscIpAddress(data)
|
model.setOscIpAddress(data)
|
||||||
config.OSC_IP_ADDRESS = data
|
config.OSC_IP_ADDRESS = data
|
||||||
return {"status":200, "result":config.OSC_IP_ADDRESS}
|
response = {"status":200, "result":config.OSC_IP_ADDRESS}
|
||||||
except Exception:
|
except Exception:
|
||||||
model.setOscIpAddress(config.OSC_IP_ADDRESS)
|
model.setOscIpAddress(config.OSC_IP_ADDRESS)
|
||||||
return {
|
response = {
|
||||||
"status":400,
|
"status":400,
|
||||||
"result":{
|
"result":{
|
||||||
"message":"Cannot set IP address",
|
"message":"Cannot set IP address",
|
||||||
"data": config.OSC_IP_ADDRESS
|
"data": config.OSC_IP_ADDRESS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return response
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getOscPort(*args, **kwargs) -> dict:
|
def getOscPort(*args, **kwargs) -> dict:
|
||||||
|
|||||||
Reference in new issue
Block a user