Skip to content

Commit

Permalink
fix: rsql_getallevents did not specified user
Browse files Browse the repository at this point in the history
  • Loading branch information
baidakovil committed Dec 26, 2023
1 parent fd3585c commit 25491a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Empty file removed db/.xdp_ggb_sqlite.db.QH3KF2
Empty file.
10 changes: 5 additions & 5 deletions db/db_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,10 @@ async def wsql_settings(self, **kw) -> int:
def_sett = asdict(UserSettings(user_id=user_id, locale=user_tg_locale))
# Get dict with current settings, if exists
cur_sett = await self.rsql_settings(user_id=user_id)
cur_sett = cur_sett.__dict__ if cur_sett is not None else def_sett
wrt_sett = cur_sett.__dict__ if cur_sett is not None else def_sett
# Replace current or default with given
use_vals = {
key: kw[key] if key in kw else cur_sett[key] for key in cur_sett.keys()
key: kw[key] if key in kw else wrt_sett[key] for key in wrt_sett.keys()
}

query = """
Expand Down Expand Up @@ -615,12 +615,12 @@ async def rsql_getallevents(self, user_id: int, shorthand: int) -> List[Tuple]:
params = {'user_id': user_id, 'shorthand': shorthand}
query = """
SELECT
(SELECT art_name FROM lastarts WHERE shorthand= :shorthand) as artist,
(SELECT art_name FROM lastarts WHERE shorthand= :shorthand AND user_id= :user_id) as artist,
event_date, place, locality, country, link FROM events WHERE
event_id IN
(SELECT event_id FROM lineups
WHERE art_name= (SELECT art_name FROM lastarts WHERE shorthand= :shorthand))
AND event_date >= (SELECT shorthand_date FROM lastarts WHERE shorthand= :shorthand)
WHERE art_name= (SELECT art_name FROM lastarts WHERE shorthand= :shorthand AND user_id= :user_id))
AND event_date >= (SELECT shorthand_date FROM lastarts WHERE shorthand= :shorthand AND user_id= :user_id)
ORDER BY event_date
"""
ev = execute_query(self, query, params=params, mode='selectmany')
Expand Down

0 comments on commit 25491a5

Please sign in to comment.