Commit f6c6734d authored by Mindiell's avatar Mindiell
Browse files

Fixed bugs on pasting

parent 60058243
......@@ -33,7 +33,7 @@ def paste():
for key in request.args.keys():
template = Vlozit().get_template(key)
if template is not None:
return render_template()
return render_template(template)
return redirect('/')
@app.route('/robots.txt')
......
......@@ -11,9 +11,8 @@ import config
class Vlozit():
def get_template(self, filename):
path = (os.path.sep).join(("pastes",filename[0:2],filename[2:4],filename[4:6],filename))
if os.path.exists(path):
return path
if os.path.exists(self.get_path(filename)):
return (os.path.sep).join(("pastes",filename[0:2],filename[2:4],filename[4:6],filename))
def get_path(self, filename):
return (os.path.sep).join(("templates/pastes",filename[0:2],filename[2:4],filename[4:6],filename))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment