From fcef417dfc707d45bfcd2baac2bbaef092eb2dc5 Mon Sep 17 00:00:00 2001 From: Amritanshu Date: Fri, 12 Sep 2014 12:52:54 +0530 Subject: [PATCH] Feature: Clients can be enabled from the client detail page. --- brewman/views/auth/client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/brewman/views/auth/client.py b/brewman/views/auth/client.py index 9d3798b2..3d8c39e0 100644 --- a/brewman/views/auth/client.py +++ b/brewman/views/auth/client.py @@ -23,8 +23,9 @@ def html(request): @TryCatchFunction def update(request): item = Client.by_id(uuid.UUID(request.matchdict['id'])) - if item.otp is None: - item.enabled = request.json_body['Enabled'] + item.enabled = request.json_body['Enabled'] + if item.enabled: + item.otp = None item.name = request.json_body['Name'] transaction.commit() return {}