From 022f41a883d397da377445f93af4fa0c6e56cf20 Mon Sep 17 00:00:00 2001 From: 0x01FE <0x10FE@0x01fe.net> Date: Wed, 26 Jun 2024 18:03:12 -0500 Subject: [PATCH] fixed some bugs that i found when deploying --- Dockerfile | 4 ---- app/post.py | 2 +- app/user.py | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9360969..05c6fe5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,8 +4,6 @@ FROM python:3.12.2-slim-bookworm RUN apt-get update && apt-get upgrade -y -RUN groupadd -r app && useradd -r -g app app - COPY . . RUN python3 -m pip install --upgrade pip @@ -13,6 +11,4 @@ RUN python3 -m pip install -r requirements.txt WORKDIR ./app -USER app - CMD ["python3", "-u", "app.py"] diff --git a/app/post.py b/app/post.py index ea9156e..8c51279 100644 --- a/app/post.py +++ b/app/post.py @@ -20,7 +20,7 @@ class Post: self.category = lines[1].split(":")[1].strip() self.author = lines[2].split(":")[1].strip() self.title = lines[6].replace('#', '').strip() - self.url = '/post/' + self.title.replace(' ', '-') + self.url = '/post/' + self.title date = lines[3].split(":")[1].strip() self.date = datetime.datetime.strptime(date, "%d-%m-%Y") diff --git a/app/user.py b/app/user.py index 6c6411b..d8b2659 100644 --- a/app/user.py +++ b/app/user.py @@ -50,7 +50,7 @@ def add_user(): with open(USERS_PATH, 'w') as file: file.write(json.dumps(user_data)) - flask.redirect('/') + return flask.redirect('/') @user.route('/user/register/') def register_page():