forked from rDrama/rDrama
handle edges cases when redirecting
parent
4adb2e5d23
commit
b49b2d0381
|
@ -1086,7 +1086,7 @@ def u_username_wall_comment(v, username, cid):
|
||||||
def u_username(v, username):
|
def u_username(v, username):
|
||||||
u = get_user(username, v=v, include_blocks=True)
|
u = get_user(username, v=v, include_blocks=True)
|
||||||
if username != u.username:
|
if username != u.username:
|
||||||
return redirect(SITE_FULL + request.full_path.replace(username, u.username))
|
return redirect(SITE_FULL + request.full_path.replace(f'/@{username}/posts', f'/@{u.username}/posts'))
|
||||||
|
|
||||||
if v and hasattr(u, 'is_blocking') and u.is_blocking:
|
if v and hasattr(u, 'is_blocking') and u.is_blocking:
|
||||||
if g.is_api_or_xhr:
|
if g.is_api_or_xhr:
|
||||||
|
|
|
@ -7,12 +7,12 @@
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<ul class="nav post-nav py-2">
|
<ul class="nav post-nav py-2">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link {% if request.path.endswith('/posts') %}active" href="{{request.path}}"{% else %}" href="{{request.path.replace('comments','posts')}}"{% endif %}>
|
<a class="nav-link {% if request.path.endswith('/posts') %}active" href="{{request.path}}"{% else %}" href="{{request.path.replace('/comments','/posts')}}"{% endif %}>
|
||||||
Posts
|
Posts
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link {% if request.path.endswith('/comments') %}active" href="{{request.path}}"{% else %}" href="{{request.path.replace('posts','comments')}}"{% endif %}>
|
<a class="nav-link {% if request.path.endswith('/comments') %}active" href="{{request.path}}"{% else %}" href="{{request.path.replace('/posts','/comments')}}"{% endif %}>
|
||||||
Comments
|
Comments
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
Loading…
Reference in New Issue