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():