Skip to content

Commit

Permalink
Merge pull request #69 from citysciencelab/hide-anonymous
Browse files Browse the repository at this point in the history
feat: hide anonymous jobs when logged in
  • Loading branch information
hwbllmnn authored Oct 31, 2024
2 parents e9ca5c9 + f791684 commit 78572df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ump/api/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def _init_from_db(self, job_id, user):
if user is None:
query += " and j.user_id is null"
else:
query += f" and (j.user_id = '{user}' or j.user_id is null or u.user_id = '{user}')"
query += f" and (j.user_id = '{user}' or u.user_id = '{user}')"

with DBHandler() as db:
job_details = db.run_query(query, query_params={"job_id": job_id})
Expand Down
2 changes: 1 addition & 1 deletion src/ump/api/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def get_jobs(args, user = None):
conditions = []
user = None if user is None else user['sub']
if user is not None:
conditions.append(f"j.user_id = '{user}' or j.user_id is null or u.user_id = '{user}'")
conditions.append(f"j.user_id = '{user}' or u.user_id = '{user}'")
else:
conditions.append('j.user_id is null')

Expand Down

0 comments on commit 78572df

Please sign in to comment.