mirror of
https://codeberg.org/catask-org/catask.git
synced 2025-04-20 13:53:42 -05:00
if question/answer is not found, return a 404
This commit is contained in:
parent
71cbd9e54b
commit
785273128d
1 changed files with 5 additions and 2 deletions
7
app.py
7
app.py
|
@ -178,8 +178,11 @@ def inbox():
|
||||||
def viewQuestion(question_id):
|
def viewQuestion(question_id):
|
||||||
question = func.getQuestion(question_id)
|
question = func.getQuestion(question_id)
|
||||||
answer = func.getAnswer(question_id)
|
answer = func.getAnswer(question_id)
|
||||||
metadata = func.generateMetadata(question, answer)
|
if not question or not answer:
|
||||||
return render_template('view_question.html', question=question, urllib=urllib, answer=answer, metadata=metadata, formatRelativeTime=func.formatRelativeTime, trimContent=func.trimContent)
|
return abort(404)
|
||||||
|
else:
|
||||||
|
metadata = func.generateMetadata(question, answer)
|
||||||
|
return render_template('view_question.html', question=question, urllib=urllib, answer=answer, metadata=metadata, formatRelativeTime=func.formatRelativeTime, trimContent=func.trimContent)
|
||||||
|
|
||||||
# TODO: implement this and private questions should be here too
|
# TODO: implement this and private questions should be here too
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Reference in a new issue