From f24e0959876062173c217112c5dc75473aa5b10e Mon Sep 17 00:00:00 2001 From: j Date: Wed, 30 Jan 2019 18:00:38 +0530 Subject: [PATCH] for update --- oml/node/nodeapi.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/oml/node/nodeapi.py b/oml/node/nodeapi.py index 93c0d49..960eecc 100644 --- a/oml/node/nodeapi.py +++ b/oml/node/nodeapi.py @@ -34,7 +34,7 @@ def api_requestPeering(user_id, username, message): return False def api_acceptPeering(user_id, username, message): - user = User.get(user_id) + user = User.get(user_id, for_update=True) if user: logger.debug('incoming acceptPeering event: pending: %s', user.pending) if user.pending == 'sent': @@ -50,7 +50,7 @@ def api_acceptPeering(user_id, username, message): return False def api_rejectPeering(user_id, message): - user = User.get(user_id) + user = User.get(user_id, for_update=True) if user: user.info['message'] = message user.update_peering(False) @@ -59,7 +59,7 @@ def api_rejectPeering(user_id, message): return False def api_removePeering(user_id, message): - user = User.get(user_id) + user = User.get(user_id, for_update=True) if user: user.info['message'] = message user.update_peering(False) @@ -68,7 +68,7 @@ def api_removePeering(user_id, message): return False def api_cancelPeering(user_id, message): - user = User.get(user_id) + user = User.get(user_id, for_update=True) if user: user.info['message'] = message user.update_peering(False)