Merge branch 'release/v1.1.0-beta' into bugfix/HTTPASTE-45/toolcahin

This commit is contained in:
Tiara Rodney 2022-04-16 07:24:19 +02:00
commit 5f6ac7bd57
3 changed files with 6 additions and 4 deletions

View file

@ -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,

View file

@ -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 = {}

View file

@ -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')