recent_history_hidden.py 642 B

1234567891011121314151617
  1. from .tool.func import *
  2. def recent_history_hidden_2(conn, name, rev):
  3. curs = conn.cursor()
  4. num = str(rev)
  5. if admin_check(6, 'history_hidden (' + name + '#' + num + ')') == 1:
  6. curs.execute(db_change("select title from history where title = ? and id = ? and hide = 'O'"), [name, num])
  7. if curs.fetchall():
  8. curs.execute(db_change("update history set hide = '' where title = ? and id = ?"), [name, num])
  9. else:
  10. curs.execute(db_change("update history set hide = 'O' where title = ? and id = ?"), [name, num])
  11. conn.commit()
  12. return redirect('/history/' + url_pas(name))