mirror of
https://github.com/norohind/jubilant-system.git
synced 2025-06-06 18:13:00 +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:
|
:param squad_id:
|
||||||
:return:
|
: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:
|
try:
|
||||||
new = sql_req.fetchone()[0]
|
new = sql_req.fetchone()[0]
|
||||||
|
@ -91,12 +91,17 @@ order by inserted_timestamp desc
|
|||||||
limit 2;"""
|
limit 2;"""
|
||||||
|
|
||||||
# AAAAAAAAA, it require to do something with it
|
# AAAAAAAAA, it require to do something with it
|
||||||
select_old_new_news: str = """select {column}
|
# select_old_new_news: str = """select {column}
|
||||||
from squads_states inner join news on
|
# from squads_states inner join news on
|
||||||
squads_states.squad_id = news.squad_id
|
# squads_states.squad_id = news.squad_id
|
||||||
and substr(squads_states.inserted_timestamp, 1, 16) = substr(news.inserted_timestamp, 1, 16)
|
# 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 = ?
|
# where category = 'Squadrons_History_Category_PublicStatement' and squads_states.squad_id = ?
|
||||||
order by squads_states.inserted_timestamp
|
# 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;"""
|
limit 2;"""
|
||||||
|
|
||||||
select_important_before_delete: str = """select name, platform, member_count, tag, user_tags, created
|
select_important_before_delete: str = """select name, platform, member_count, tag, user_tags, created
|
||||||
|
Loading…
x
Reference in New Issue
Block a user