recent_history_hidden.py 732 B

12345678910111213141516
  1. from .tool.func import *
  2. async def recent_history_hidden(name = 'Test', rev = 1):
  3. with get_db_connect() as conn:
  4. curs = conn.cursor()
  5. num = str(rev)
  6. if await acl_check(tool = 'hidel_auth', memo = 'history_hidden (' + name + '#' + num + ')') != 1:
  7. curs.execute(db_change("select title from history where title = ? and id = ? and hide = 'O'"), [name, num])
  8. if curs.fetchall():
  9. curs.execute(db_change("update history set hide = '' where title = ? and id = ?"), [name, num])
  10. else:
  11. curs.execute(db_change("update history set hide = 'O' where title = ? and id = ?"), [name, num])
  12. return redirect(conn, '/history/' + url_pas(name))