More small fixes

This commit is contained in:
Scott Wallace 2021-12-28 16:36:04 +00:00
parent 572fcbed6d
commit f4db481273
Signed by: scott
GPG key ID: AA742FDC5AFE2A72
2 changed files with 3 additions and 2 deletions

View file

@ -21,7 +21,7 @@ class ShortURL(Base): # type: ignore[misc, valid-type] # pylint: disable=too-f
shortcode = Column(String(128), unique=True, nullable=False)
url = Column(String(2048), unique=False, nullable=False)
fixed_views = Column(Integer, unique=False, nullable=False)
expiry = Column(Integer, unique=False, nullable=False)
expiry = Column(String(26), unique=False, nullable=False)
@dataclass
@ -29,6 +29,7 @@ class ShortcodeDB:
"""
Class to represent the database
"""
url: str
def session(self) -> Session:

View file

@ -90,7 +90,7 @@ def protect(func: Callable[..., Response]) -> Callable[..., Response]:
return check_ip
@slinky_webapp.route('/<path:path>')
@slinky_webapp.route('/<path:path>', strict_slashes=False)
def try_path_as_shortcode(path: str) -> Response:
"""
Try the initial path as a shortcode, redirect if found