Add ability to flush recently_added database table

This commit is contained in:
JonnyWong16 2020-03-23 17:50:54 -07:00
parent 9725c82187
commit 08c8ee0774
4 changed files with 56 additions and 21 deletions

View file

@ -352,6 +352,20 @@ class WebInterface(object):
else:
return {'result': 'error', 'message': 'Flush sessions failed.'}
@cherrypy.expose
@cherrypy.tools.json_out()
@requireAuth(member_of("admin"))
@addtoapi()
def delete_recently_added(self, **kwargs):
""" Flush out all of the recently added items in the database."""
result = database.delete_recently_added()
if result:
return {'result': 'success', 'message': 'Recently added flushed.'}
else:
return {'result': 'error', 'message': 'Flush recently added failed.'}
##### Libraries #####