remotes/1693045480750635534/spooky-22
Aevann1 2022-01-28 22:02:35 +02:00
parent ecc7f1e622
commit 716b4ee2ea
9 changed files with 14 additions and 12 deletions

View File

@ -34,7 +34,7 @@ class OauthApp(Base):
@property
@lazy
def permalink(self): return f"/admin/app/{self.id}"
def permalink(self): return f"{SITE_FULL}/admin/app/{self.id}"
@lazy
def idlist(self, page=1):

View File

@ -233,10 +233,10 @@ class Comment(Base):
@property
@lazy
def permalink(self):
if self.post and self.post.club: return f"/comment/{self.id}?context=9#context"
if self.post and self.post.club: return f"{SITE_FULL}/comment/{self.id}?context=9#context"
if self.post: return f"{self.post.permalink}/{self.id}?context=9#context"
else: return f"/comment/{self.id}?context=9#context"
if self.post: return f"{SITE_FULL}{self.post.permalink}/{self.id}?context=9#context"
else: return f"{SITE_FULL}/comment/{self.id}?context=9#context"
@property
@lazy

View File

@ -108,7 +108,7 @@ class ModAction(Base):
@property
@lazy
def permalink(self):
return f"/log/{self.id}"
return f"{SITE_FULL}/log/{self.id}"
ACTIONTYPES={
"grant_awards": {

View File

@ -197,7 +197,7 @@ class Submission(Base):
@property
@lazy
def permalink(self):
if self.club: return f"/post/{self.id}"
if self.club: return f"{SITE_FULL}/post/{self.id}"
output = self.title.lower()
@ -210,7 +210,7 @@ class Submission(Base):
if not output: output = '-'
return f"/post/{self.id}/{output}"
return f"{SITE_FULL}/post/{self.id}/{output}"
@property
@lazy

View File

@ -313,7 +313,7 @@ class User(Base):
@property
@lazy
def url(self):
return f"/@{self.username}"
return f"{SITE_FULL}/@{self.username}"
def __repr__(self):
return f"<User(id={self.id})>"

View File

@ -61,5 +61,7 @@ def error_500(e):
def allow_nsfw():
session["over_18"] = int(time.time()) + 3600
redir = request.values.get("redir")
if redir and redir.startswith(SITE_FULL) or redir.startswith('/'): return redirect(redir)
if redir:
if redir.startswith(SITE_FULL): return redirect(redir)
if redir.startswith('/'): return redirect(f'{SITE_FULL}{redir}')
return redirect(f'{SITE_FULL}/')

View File

@ -666,7 +666,7 @@ def u_username(username, v=None):
if username != u.username:
return redirect(request.full_path.replace(username, u.username))
return redirect(SITE_FULL + request.full_path.replace(username, u.username))
if u.reserved:
if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error": f"That username is reserved for: {u.reserved}"}

View File

@ -908,7 +908,7 @@
{% include "expanded_image_modal.html" %}
<script src="/static/assets/js/comments+submission_listing.js?a=220"></script>
<script src="/static/assets/js/comments+submission_listing.js?a=221"></script>
<script src="/static/assets/js/comments.js?a=221"></script>
<script>

View File

@ -694,5 +694,5 @@
</style>
<script src="/static/assets/js/clipboard.js?a=220"></script>
<script src="/static/assets/js/comments+submission_listing.js?a=220"></script>
<script src="/static/assets/js/comments+submission_listing.js?a=221"></script>
<script src="/static/assets/js/submission_listing.js?a=220"></script>