Feature: Clients can be enabled from the client detail page.

This commit is contained in:
Amritanshu 2014-09-12 12:52:54 +05:30
parent 62c8b64370
commit fcef417dfc

View File

@ -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 {}