We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1c9aa5f commit cd36080Copy full SHA for cd36080
1 file changed
pyhackers/controllers/main.py
@@ -287,13 +287,13 @@ def user_profile(nick):
287
os_projects=os_projects)
288
289
290
-@cache.cached(timeout=10000)
+@cache.cached(timeout=10000, unless=request_force_non_cache)
291
+def find_tutorial(slug):
292
+ return Tutorial.query.filter_by(slug=slug).first()
293
+
294
@main_app.route('/tutorial/<regex(".+"):nick>/<regex(".+"):tutorial>')
295
def tutorial(nick, tutorial):
- slug = "{}/{}".format(nick,tutorial)
- tutorial_obj = Tutorial.query.filter_by(slug=slug).first()
-
296
- return render_base_template("tutorial.html", tutorial=tutorial_obj)
+ return render_template("tutorial.html", tutorial=find_tutorial("{}/{}".format(nick, tutorial)))
297
298
@main_app.route("/authenticate")
299
def authenticate():
0 commit comments