I figure out flake_ids
Go figure Pleroma can't even use hexadecimal numbers. Nope, base62 is clearly the way to go. They're working for me, at any rate.
This commit is contained in:
parent
aca2adcd27
commit
9ac01a85d1
|
@ -45,8 +45,13 @@ urlpatterns = [
|
||||||
path("tags/<tag>", views.tag, name="tag"),
|
path("tags/<tag>", views.tag, name="tag"),
|
||||||
path("user/", views.home, name="user_bad"),
|
path("user/", views.home, name="user_bad"),
|
||||||
path("user/<username>", views.user, name="user"),
|
path("user/<username>", views.user, name="user"),
|
||||||
path("user/<username>/next/<int:next>", views.user, name="user_next"),
|
# next/prev are integers, but pleroma uses 128 bit integers
|
||||||
path("user/<username>/prev/<int:prev>", views.user, name="user_prev"),
|
# ...encoded in Base62.
|
||||||
|
# aka a "flake_id"
|
||||||
|
# from baseconv import base62, but we don't need to decode it
|
||||||
|
# just pass it along back to pleroma but it is NOT an <int:>
|
||||||
|
path("user/<username>/next/<next>", views.user, name="user_next"),
|
||||||
|
path("user/<username>/prev/<prev>", views.user, name="user_prev"),
|
||||||
path("toot/<mention>", views.toot, name="toot"),
|
path("toot/<mention>", views.toot, name="toot"),
|
||||||
path("toot", views.toot, name="toot"),
|
path("toot", views.toot, name="toot"),
|
||||||
path("reply/<id>", views.reply, name="reply"),
|
path("reply/<id>", views.reply, name="reply"),
|
||||||
|
|
|
@ -29,6 +29,7 @@ from time import sleep
|
||||||
from requests import Session
|
from requests import Session
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
|
||||||
class NotLoggedInException(Exception):
|
class NotLoggedInException(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -142,10 +143,7 @@ def br_login_required(function=None, home_url=None, redirect_field_name=None):
|
||||||
url = "/"
|
url = "/"
|
||||||
return HttpResponseRedirect(url)
|
return HttpResponseRedirect(url)
|
||||||
else:
|
else:
|
||||||
try:
|
return view_func(request, *args, **kwargs)
|
||||||
return view_func(request, *args, **kwargs)
|
|
||||||
except:
|
|
||||||
print(view_func, function)
|
|
||||||
|
|
||||||
_view.__name__ = view_func.__name__
|
_view.__name__ = view_func.__name__
|
||||||
_view.__dict__ = view_func.__dict__
|
_view.__dict__ = view_func.__dict__
|
||||||
|
@ -740,8 +738,6 @@ def user(request, username, prev=None, next=None):
|
||||||
next = data[-1]._pagination_next
|
next = data[-1]._pagination_next
|
||||||
except (IndexError, AttributeError, KeyError):
|
except (IndexError, AttributeError, KeyError):
|
||||||
next = None
|
next = None
|
||||||
help(render)
|
|
||||||
raise SystemExit(23)
|
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
"main/user.html",
|
"main/user.html",
|
||||||
|
|
Loading…
Reference in New Issue