Add ability to flush recently_added database table

This commit is contained in:
JonnyWong16 2020-03-23 17:49:51 -07:00
parent d54794e85f
commit 395fc49087
4 changed files with 56 additions and 21 deletions

View file

@ -341,6 +341,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 #####