Skip to content

Commit

Permalink
🔧 chore: Update chocolate_app version to 10.1.3-alpha and modify defa…
Browse files Browse the repository at this point in the history
…ult profile picture handling
  • Loading branch information
Impre-visible committed Nov 18, 2024
1 parent f53f609 commit 3af6169
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Dockerfile_base
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM python:3.10

RUN apt-get update && apt-get install -y ffmpeg unrar-free

RUN pip install chocolate_app==10.1.2a0
RUN pip install chocolate_app==10.1.3a0

EXPOSE 8888

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "chocolate_app"
version = "10.1.2-alpha"
version = "10.1.3-alpha"
description = ""
authors = [
{ name = "Imprevisible", email = "[email protected]" },
Expand Down
2 changes: 1 addition & 1 deletion src/chocolate_app/routes/api/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def signup():
name=account_name,
password=account_password,
account_type=account_type,
profile_picture="static/images/default_profile_picture.jpg",
profile_picture=f"data:image/jpeg;base64,{image_to_base64(dir_path+'/static/img/avatars/defaultUserProfilePic.png', 200, 200)}",
)

DB.session.add(user)
Expand Down
7 changes: 3 additions & 4 deletions src/chocolate_app/routes/api/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
from iso639 import Lang

from chocolate_app import DB, get_config, get_dir_path, write_config
from chocolate_app.routes.api.auth import token_required
from chocolate_app.routes.api.auth import image_to_base64, token_required
from flask import Blueprint, request, Response
from chocolate_app.tables import Libraries, Users
from chocolate_app.utils.utils import generate_response, Codes


settings_bp = Blueprint("settings", __name__, url_prefix="/settings")

dir_path = get_dir_path()

def clean_json_for_config(json: dict) -> dict:
for key, value in json.items():
Expand Down Expand Up @@ -123,7 +123,7 @@ def put() -> Response:
name=data["name"],
password=data["password"],
account_type=data["account_type"],
profile_picture="static/images/default_profile_picture.jpg",
profile_picture=f"data:image/jpeg;base64,{image_to_base64(dir_path+'/static/img/avatars/defaultUserProfilePic.png', 200, 200)}",
)
DB.session.add(user)
DB.session.commit()
Expand Down Expand Up @@ -255,7 +255,6 @@ def settings(section) -> Response:
@settings_bp.route("/languages", methods=["GET"])
def languages() -> Response:
languages = []
dir_path = get_dir_path()
for file in os.listdir(f"{dir_path}/static/lang"):
if file.endswith(".json"):
languages.append(file[:-5])
Expand Down

0 comments on commit 3af6169

Please sign in to comment.