fix: bug when editing pages with dots in name

This commit is contained in:
Matthew Scragg 2016-04-24 18:33:25 -05:00
parent 71de000b2c
commit a5a1a031d8

View file

@ -76,16 +76,15 @@ def history(name):
@login_required @login_required
def edit(name): def edit(name):
cname = to_canonical(name) cname = to_canonical(name)
page = g.current_wiki.get_page(name) page = g.current_wiki.get_page(cname)
if not page: if not page:
# Page doesn't exist # Page doesn't exist
return redirect(url_for('wiki.create', name=cname)) return redirect(url_for('wiki.create', name=cname))
name = remove_ext(page['path'])
g.assets['js'].append('editor.js') g.assets['js'].append('editor.js')
return render_template('wiki/edit.html', return render_template('wiki/edit.html',
name=name, name=cname,
content=page.get('data'), content=page.get('data'),
info=page.get('info'), info=page.get('info'),
sha=page.get('sha'), sha=page.get('sha'),