Merge branch 'release/v1.1.0-beta' into bugfix/HTTPASTE-45/toolcahin
This commit is contained in:
commit
5f6ac7bd57
3 changed files with 6 additions and 4 deletions
|
|
@ -6,7 +6,7 @@ from httpaste.helper.common import decode, DecodeError, join_url
|
|||
import httpaste.model.paste as paste_model
|
||||
import httpaste.model.user as user_model
|
||||
from httpaste.backend import load_backend
|
||||
from httpaste.helper.http import BadRequestError, GoneError, NotFoundError
|
||||
from httpaste.helper.http import BadRequestError, GoneError, NotFoundError, ForbiddenError
|
||||
from httpaste.helper.syntax import highlight
|
||||
from httpaste.schema import (
|
||||
PasteKey,
|
||||
|
|
|
|||
|
|
@ -54,12 +54,14 @@ def get(**kwargs):
|
|||
|
||||
template = views.get_template("viewport/ui/paste/get.html")
|
||||
|
||||
|
||||
|
||||
base_path = f'paste/public/{kwargs["id"]}'
|
||||
|
||||
raw_paste_url = f'{request.host_url}{base_path}'
|
||||
if kwargs.get('user'):
|
||||
raw_paste_url = f'{request.host_url}{base_path}'
|
||||
base_path = f'paste/private/{kwargs["id"]}'
|
||||
|
||||
raw_paste_url = f'{request.host_url}{base_path}'
|
||||
paste_url = raw_paste_url
|
||||
|
||||
paste_url_query = {}
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ def load(proto: Paste, backend: object) -> Optional[Paste]:
|
|||
if proto.sub and model.sub != shash(
|
||||
proto.sub,
|
||||
model.data_hash,
|
||||
proto.pid) or not proto.sub and model.sub:
|
||||
proto.pid) or (not proto.sub and model.sub):
|
||||
|
||||
raise SubError('Paste not owned by user')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue