Fix ordering in python versions that don't have ordered dicts

parent 9429f2da
......@@ -136,7 +136,6 @@ def list_shortlinks_page(page, limit=50):
assert type(limit) == int
start_index = (page - 1) * limit
result = query_db('SELECT * FROM urls ORDER BY short LIMIT ? OFFSET ?', (limit, start_index), False, None)
result = nested_list_to_dict(result)
return result
......@@ -370,6 +369,7 @@ def admin():
page = 1
urls = list_shortlinks_page(page, app.config['admin_links_per_page'])
return render_template('admin.html', urls=urls, page=page, page_count=page_count, num_items=num_items)
else:
return render_template('login.html')
......
......@@ -69,7 +69,7 @@ A copy of the MIT license can be obtained at https://mit-license.org/
<th>Long link</th>
<th>Delete?</th>
</tr>
{% for long, short in urls.items() %}
{% for long, short in urls %}
<tr>
<td>{{ short }}</td>
<td>{{ long }}</td>
......
Markdown is supported
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