Feature: Clients can be enabled from the client detail page.
This commit is contained in:
parent
62c8b64370
commit
fcef417dfc
|
@ -23,8 +23,9 @@ def html(request):
|
||||||
@TryCatchFunction
|
@TryCatchFunction
|
||||||
def update(request):
|
def update(request):
|
||||||
item = Client.by_id(uuid.UUID(request.matchdict['id']))
|
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']
|
item.name = request.json_body['Name']
|
||||||
transaction.commit()
|
transaction.commit()
|
||||||
return {}
|
return {}
|
||||||
|
|
Loading…
Reference in New Issue