| 1234567891011121314151617181920212223 |
- from .tool.func import *
- def watch_list_name_2(conn, name):
- curs = conn.cursor()
-
- ip = ip_check()
- if ip_or_user(ip) != 0:
- return redirect('/login')
- curs.execute("select count(title) from scan where user = ?", [ip])
- count = curs.fetchall()
- if count and count[0][0] > 9:
- return redirect('/watch_list')
- curs.execute("select title from scan where user = ? and title = ?", [ip, name])
- if curs.fetchall():
- curs.execute("delete from scan where user = ? and title = ?", [ip, name])
- else:
- curs.execute("insert into scan (user, title) values (?, ?)", [ip, name])
-
- conn.commit()
- return redirect('/watch_list')
|