Browse Source

현직 관리자만 ✅ 쓰도록

https://github.com/openNAMU/openNAMU/issues/2186
잉여개발기 (SPDV) 2 years ago
parent
commit
44d96bd669
2 changed files with 10 additions and 1 deletions
  1. 6 0
      app.py
  2. 4 1
      route/tool/func.py

+ 6 - 0
app.py

@@ -324,6 +324,12 @@ def do_every_day():
 
             print('Make sitemap')
 
+        # 칭호 관리
+        curs.execute(db_change("select id from user_set where name = 'user_title' and data = '✅'"))
+        for for_a in curs.fetchall():
+            if admin_check(conn, 'all', None, for_a[0]) != 1:
+                curs.execute(db_change("update user_set set data = '☑️' where name = 'user_title' and data = '✅' and id = ?"), [for_a[0]])
+
         threading.Timer(60 * 60 * 24, do_every_day).start()
 
 def auto_do_something(data_db_set):

+ 4 - 1
route/tool/func.py

@@ -844,7 +844,10 @@ def get_user_title_list(conn, ip = ''):
 
     curs.execute(db_change('select data from user_set where name = ? and id = ?'), ['challenge_admin', ip])
     if curs.fetchall():
-        user_title['☑️'] = '☑️ admin'
+        user_title['☑️'] = '☑️ before_admin'
+
+    if admin_check(conn, 'all') == 1:
+        user_title['✅'] = '✅ admin'
     
     return user_title