Verified Commit cdb6a883 authored by Kevin Alberts's avatar Kevin Alberts
Browse files

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

parent 9429f2da
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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')
+1 −1
Original line number Diff line number Diff line
@@ -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>