diff --git a/drama/routes/admin.py b/drama/routes/admin.py index 0c0d10106..0597d7d3b 100644 --- a/drama/routes/admin.py +++ b/drama/routes/admin.py @@ -54,7 +54,7 @@ def flagged_posts(v): listing = [p.id for p in posts] next_exists = (len(listing) == 26) - listing = listing[0:25] + listing = listing[:25] listing = get_posts(listing, v=v) @@ -75,7 +75,7 @@ def image_posts_listing(v): posts = [x.id for x in posts] next_exists = (len(posts) == 26) - posts = posts[0:25] + posts = posts[:25] posts = get_posts(posts, v=v) @@ -105,7 +105,7 @@ def flagged_comments(v): listing = [p.id for p in posts] next_exists = (len(listing) == 26) - listing = listing[0:25] + listing = listing[:25] listing = get_comments(listing, v=v) @@ -221,7 +221,7 @@ def users_list(v): users = [x for x in users] next_exists = (len(users) == 26) - users = users[0:25] + users = users[:25] return render_template("admin/new_users.html", v=v, @@ -408,7 +408,7 @@ def admin_removed(v): next_exists = len(ids) == 26 - ids = ids[0:25] + ids = ids[:25] posts = get_posts(ids, v=v) diff --git a/drama/routes/front.py b/drama/routes/front.py index dda55485b..d91be67b2 100644 --- a/drama/routes/front.py +++ b/drama/routes/front.py @@ -204,7 +204,7 @@ def front_all(v): # check existence of next page next_exists = (len(posts) == 26) - posts = posts[0:25] + posts = posts[:25] if request.path == "/": return render_template("home.html", v=v, listing=posts, next_exists=next_exists, sort=sort, t=t, page=page) else: return jsonify({"data": [x.json for x in posts], "next_exists": next_exists}) @@ -303,7 +303,7 @@ def changelog(v): # check existence of next page next_exists = (len(ids) == 26) - ids = ids[0:25] + ids = ids[:25] # check if ids exist posts = get_posts(ids, v=v) @@ -418,7 +418,7 @@ def all_comments(v): next_exists = len(idlist) == 26 - idlist = idlist[0:25] + idlist = idlist[:25] return {"html": lambda: render_template("home_comments.html", v=v, diff --git a/drama/routes/oauth.py b/drama/routes/oauth.py index a5f8eccaa..cad56bb0d 100644 --- a/drama/routes/oauth.py +++ b/drama/routes/oauth.py @@ -229,7 +229,7 @@ def request_api_keys(v): app_name=request.form.get('name'), redirect_uri=request.form.get('redirect_uri'), author_id=v.id, - description=request.form.get("description")[0:256] + description=request.form.get("description")[:256] ) g.db.add(new_app) @@ -267,7 +267,7 @@ def edit_oauth_app(v, aid): app.redirect_uri = request.form.get('redirect_uri') app.app_name = request.form.get('name') - app.description = request.form.get("description")[0:256] + app.description = request.form.get("description")[:256] g.db.add(app) diff --git a/drama/routes/search.py b/drama/routes/search.py index 88f4584b7..c846a157d 100644 --- a/drama/routes/search.py +++ b/drama/routes/search.py @@ -215,7 +215,7 @@ def searchposts(v, search_type="posts"): total, ids = searchlisting(criteria, v=v, page=page, t=t, sort=sort) next_exists = (len(ids) == 26) - ids = ids[0:25] + ids = ids[:25] posts = get_posts(ids, v=v) @@ -262,7 +262,7 @@ def searchcomments(v): total, ids = searchcommentlisting(criteria, v=v, page=page, t=t, sort=sort) next_exists = (len(ids) == 26) - ids = ids[0:25] + ids = ids[:25] comments = get_comments(ids, v=v) @@ -305,7 +305,7 @@ def searchusers(v, search_type="posts"): users=[x for x in users.offset(25 * (page-1)).limit(26)] next_exists=(len(users)==26) - users=users[0:25] + users=users[:25] diff --git a/drama/routes/users.py b/drama/routes/users.py index 73e2af129..eaade85f3 100644 --- a/drama/routes/users.py +++ b/drama/routes/users.py @@ -291,7 +291,7 @@ def u_username(username, v=None): # we got 26 items just to see if a next page exists next_exists = (len(ids) == 26) - ids = ids[0:25] + ids = ids[:25] # If page 1, check for sticky if page == 1: @@ -391,7 +391,7 @@ def u_username_comments(username, v=None): # we got 26 items just to see if a next page exists next_exists = (len(ids) == 26) - ids = ids[0:25] + ids = ids[:25] listing = get_comments(ids, v=v) @@ -497,7 +497,7 @@ def saved_posts(v, username): next_exists=len(ids)==26 - ids=ids[0:25] + ids=ids[:25] listing = get_posts(ids, v=v) @@ -524,7 +524,7 @@ def saved_comments(v, username): next_exists=len(ids)==26 - ids=ids[0:25] + ids=ids[:25] listing = get_comments(ids, v=v, sort="new")