Skip to content

Commit

Permalink
🐛 fix page vists title on deleted entries
Browse files Browse the repository at this point in the history
  • Loading branch information
FredrikMorstad committed Nov 8, 2023
1 parent e839d71 commit 1761ce8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ def get_event_title_from_path(db, path):
if not id:
return None
event = db.events.find_one({ 'eid': id })
if not event:
return "Et slettet arrangement"
return event["title"]

# get job title from path, can be extended to retrieve other fields
Expand All @@ -118,6 +120,8 @@ def get_job_title_from_path(db, path):
if not id:
return None
job = db.jobs.find_one({ 'id': id })
if not job:
return "En slettet stillingsultlysning"
return job["title"]

# function for finding objects for the paths containing uuid
Expand Down

0 comments on commit 1761ce8

Please sign in to comment.