mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 07:46:07 -07:00
Add ability to delete users
This commit is contained in:
parent
c501923f2b
commit
1c00f82097
7 changed files with 160 additions and 21 deletions
|
@ -1397,6 +1397,40 @@ class WebInterface(object):
|
|||
cherrypy.response.headers['Content-type'] = 'application/json'
|
||||
return json.dumps({'message': 'no data received'})
|
||||
|
||||
@cherrypy.expose
|
||||
def delete_user(self, user_id, **kwargs):
|
||||
data_factory = datafactory.DataFactory()
|
||||
|
||||
if user_id:
|
||||
delete_row = data_factory.delete_user(user_id=user_id)
|
||||
|
||||
if delete_row:
|
||||
cherrypy.response.headers['Content-type'] = 'application/json'
|
||||
return json.dumps({'message': delete_row})
|
||||
else:
|
||||
cherrypy.response.headers['Content-type'] = 'application/json'
|
||||
return json.dumps({'message': 'no data received'})
|
||||
|
||||
@cherrypy.expose
|
||||
def undelete_user(self, user_id=None, username=None, **kwargs):
|
||||
data_factory = datafactory.DataFactory()
|
||||
|
||||
if user_id:
|
||||
delete_row = data_factory.undelete_user(user_id=user_id)
|
||||
|
||||
if delete_row:
|
||||
cherrypy.response.headers['Content-type'] = 'application/json'
|
||||
return json.dumps({'message': delete_row})
|
||||
elif username:
|
||||
delete_row = data_factory.undelete_user(username=username)
|
||||
|
||||
if delete_row:
|
||||
cherrypy.response.headers['Content-type'] = 'application/json'
|
||||
return json.dumps({'message': delete_row})
|
||||
else:
|
||||
cherrypy.response.headers['Content-type'] = 'application/json'
|
||||
return json.dumps({'message': 'no data received'})
|
||||
|
||||
@cherrypy.expose
|
||||
def search(self, query=''):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue