mirror of
https://github.com/norohind/jubilant-system.git
synced 2025-06-04 09:20:57 +03:00
fix news hook
This commit is contained in:
parent
727955d0ec
commit
9357a2ecfa
2
hooks.py
2
hooks.py
@ -267,7 +267,7 @@ def new_old_news_diff(column: str, db_conn: sqlite3.Connection, squad_id: int) -
|
||||
:param squad_id:
|
||||
:return:
|
||||
"""
|
||||
sql_req: sqlite3.Cursor = db_conn.execute(sql_requests.select_old_new_news.format(column=column), (squad_id,))
|
||||
sql_req: sqlite3.Cursor = db_conn.execute(sql_requests.select_new_old_news.format(column=column), (squad_id,))
|
||||
|
||||
try:
|
||||
new = sql_req.fetchone()[0]
|
||||
|
@ -91,12 +91,17 @@ order by inserted_timestamp desc
|
||||
limit 2;"""
|
||||
|
||||
# AAAAAAAAA, it require to do something with it
|
||||
select_old_new_news: str = """select {column}
|
||||
from squads_states inner join news on
|
||||
squads_states.squad_id = news.squad_id
|
||||
and substr(squads_states.inserted_timestamp, 1, 16) = substr(news.inserted_timestamp, 1, 16)
|
||||
where category = 'Squadrons_History_Category_PublicStatement' and squads_states.squad_id = ?
|
||||
order by squads_states.inserted_timestamp
|
||||
# select_old_new_news: str = """select {column}
|
||||
# from squads_states inner join news on
|
||||
# squads_states.squad_id = news.squad_id
|
||||
# and substr(squads_states.inserted_timestamp, 1, 16) = substr(news.inserted_timestamp, 1, 16)
|
||||
# where category = 'Squadrons_History_Category_PublicStatement' and squads_states.squad_id = ?
|
||||
# order by squads_states.inserted_timestamp
|
||||
# limit 2;"""
|
||||
select_new_old_news: str = """select {column}
|
||||
from news
|
||||
where squad_id = ? and category = 'Squadrons_History_Category_PublicStatement'
|
||||
order by inserted_timestamp desc
|
||||
limit 2;"""
|
||||
|
||||
select_important_before_delete: str = """select name, platform, member_count, tag, user_tags, created
|
||||
|
Loading…
x
Reference in New Issue
Block a user