fixed some bugs that i found when deploying

This commit is contained in:
0x01FE 2024-06-26 18:03:12 -05:00
parent e69ec565f7
commit 022f41a883
3 changed files with 2 additions and 6 deletions

View File

@ -4,8 +4,6 @@ FROM python:3.12.2-slim-bookworm
RUN apt-get update && apt-get upgrade -y RUN apt-get update && apt-get upgrade -y
RUN groupadd -r app && useradd -r -g app app
COPY . . COPY . .
RUN python3 -m pip install --upgrade pip RUN python3 -m pip install --upgrade pip
@ -13,6 +11,4 @@ RUN python3 -m pip install -r requirements.txt
WORKDIR ./app WORKDIR ./app
USER app
CMD ["python3", "-u", "app.py"] CMD ["python3", "-u", "app.py"]

View File

@ -20,7 +20,7 @@ class Post:
self.category = lines[1].split(":")[1].strip() self.category = lines[1].split(":")[1].strip()
self.author = lines[2].split(":")[1].strip() self.author = lines[2].split(":")[1].strip()
self.title = lines[6].replace('#', '').strip() self.title = lines[6].replace('#', '').strip()
self.url = '/post/' + self.title.replace(' ', '-') self.url = '/post/' + self.title
date = lines[3].split(":")[1].strip() date = lines[3].split(":")[1].strip()
self.date = datetime.datetime.strptime(date, "%d-%m-%Y") self.date = datetime.datetime.strptime(date, "%d-%m-%Y")

View File

@ -50,7 +50,7 @@ def add_user():
with open(USERS_PATH, 'w') as file: with open(USERS_PATH, 'w') as file:
file.write(json.dumps(user_data)) file.write(json.dumps(user_data))
flask.redirect('/') return flask.redirect('/')
@user.route('/user/register/') @user.route('/user/register/')
def register_page(): def register_page():