From ca987eb12ee59ec6216c68779f38cb075526f3c3 Mon Sep 17 00:00:00 2001 From: marcusgc Date: Tue, 19 May 2015 16:01:22 -0300 Subject: [PATCH] Update views.py minor changes. Changes in variable name and range for member_checked_status --- networkapi/api_pools/views.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/networkapi/api_pools/views.py b/networkapi/api_pools/views.py index 210ec8579..97028b75b 100644 --- a/networkapi/api_pools/views.py +++ b/networkapi/api_pools/views.py @@ -201,14 +201,14 @@ def list_all_members_by_pool(request, id_server_pool): raise exceptions.ScriptCheckStatusPoolMemberException(detail="Script did not return as expected.") for pms in serializer_pools.data: - abc = script_out[id_server_pool]["%d"%pms["id"]] - if abc not in range(1,8): + member_checked_status = script_out[id_server_pool]["%d"%pms["id"]] + if member_checked_status not in range(0,8): raise exceptions.ScriptCheckStatusPoolMemberException(detail="Status script did not return as expected.") - pms["member_status"] = abc + pms["member_status"] = member_checked_status #Save to BD pm = query_pools.get(id=pms["id"]) - pm.member_status = abc + pm.member_status = member_checked_status pm.save(request.user) data["server_pool_members"] = serializer_pools.data @@ -1037,4 +1037,4 @@ def management_pools(request): except Exception, exception: log.error(exception) - raise api_exceptions.NetworkAPIException() \ No newline at end of file + raise api_exceptions.NetworkAPIException()