Browse Source

Shortener: redirect with domain included

merge-requests/53/head
Deimos 6 years ago
parent
commit
50df1a6f2c
  1. 4
      tildes/tildes/views/shortener.py

4
tildes/tildes/views/shortener.py

@ -20,10 +20,10 @@ def get_shortener(request: Request) -> Response:
@view_config(route_name="shortener_group", permission=NO_PERMISSION_REQUIRED) @view_config(route_name="shortener_group", permission=NO_PERMISSION_REQUIRED)
def get_shortener_group(request: Request) -> HTTPFound: def get_shortener_group(request: Request) -> HTTPFound:
"""Redirect to the base path of a group.""" """Redirect to the base path of a group."""
raise HTTPFound(location=f"/~{request.context.path}")
raise HTTPFound(location=f"https://tildes.net/~{request.context.path}")
@view_config(route_name="shortener_topic", permission=NO_PERMISSION_REQUIRED) @view_config(route_name="shortener_topic", permission=NO_PERMISSION_REQUIRED)
def get_shortener_topic(request: Request) -> HTTPFound: def get_shortener_topic(request: Request) -> HTTPFound:
"""Redirect to the full permalink for a topic.""" """Redirect to the full permalink for a topic."""
raise HTTPFound(location=request.context.permalink)
raise HTTPFound(location=f"https://tildes.net{request.context.permalink}")
Loading…
Cancel
Save