mirror of
https://github.com/norohind/jubilant-system.git
synced 2025-04-20 16:07:36 +03:00
Fix news diff
This commit is contained in:
parent
9357a2ecfa
commit
427bb4222a
@ -100,7 +100,7 @@ limit 2;"""
|
||||
# limit 2;"""
|
||||
select_new_old_news: str = """select {column}
|
||||
from news
|
||||
where squad_id = ? and category = 'Squadrons_History_Category_PublicStatement'
|
||||
where squad_id = ? and type_of_news = 'public_statements'
|
||||
order by inserted_timestamp desc
|
||||
limit 2;"""
|
||||
|
||||
|
13
utils.py
13
utils.py
@ -238,6 +238,19 @@ def _update_squad_news(squad_id: int, db_conn: sqlite3.Connection) -> Union[bool
|
||||
for type_of_news_key in squad_news:
|
||||
one_type_of_news: list = squad_news[type_of_news_key]
|
||||
|
||||
if len(squad_news[type_of_news_key]) == 0:
|
||||
logger.info(f'squad_news[{type_of_news_key}] len == 0')
|
||||
|
||||
with db_conn:
|
||||
db_conn.execute(
|
||||
sql_requests.insert_news,
|
||||
(
|
||||
squad_id,
|
||||
type_of_news_key,
|
||||
*[None for i in range(0, 10)]
|
||||
)
|
||||
)
|
||||
|
||||
news: dict
|
||||
for news in one_type_of_news:
|
||||
with db_conn:
|
||||
|
Loading…
x
Reference in New Issue
Block a user