[rewrite] Major changes to code - switched to postgres, added initial backend docker files
This commit is contained in:
1 parent
c7e20fc935
commit
71e916586e
52 files changed
+783
-537
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import imghdr
|
||||
|
||||
|
||||
def is_base64_jpg(decoded_string) -> bool:
|
||||
try:
|
||||
image_type = imghdr.what(None, decoded_string)
|
||||
|
||||
@@ -5,6 +5,7 @@ import app.messages.api_errors as errors
|
||||
|
||||
from app.db import product_db
|
||||
|
||||
|
||||
def product_list(page: int):
|
||||
try:
|
||||
result_products = product_db.fetch_products(page)
|
||||
|
||||
@@ -11,6 +11,7 @@ from app.mail.mail import send_mail
|
||||
|
||||
from app.messages.mail_responses.user_email import USER_EMAIL_SUCCESSFULLY_DELETED_ACCOUNT
|
||||
|
||||
|
||||
def delete_user(user_id: str) -> Tuple[Union[dict, str], int]:
|
||||
"""
|
||||
Deletes a user account.
|
||||
|
||||
@@ -13,7 +13,6 @@ from app.models.user_model import User
|
||||
from app.messages.mail_responses.user_email import USER_EMAIL_SUCCESSFULLY_LOGGED_IN
|
||||
|
||||
|
||||
|
||||
def login(username: str, password: str) -> Tuple[Union[dict, str], int]:
|
||||
"""
|
||||
Authenticates a user with the provided username and password.
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
from app.database.manager import DatabaseManager
|
||||
from app.models.user_model import User
|
||||
from app.database.models.user_model import User
|
||||
|
||||
from app.schemas.user_schemas import UserRegisterSchema
|
||||
|
||||
from app.core.security import get_password_hash
|
||||
|
||||
|
||||
def create_user(user_data: UserRegisterSchema):
|
||||
print("Creating user")
|
||||
return
|
||||
print("Creating account")
|
||||
with DatabaseManager.get_session() as session:
|
||||
user = User(
|
||||
username=user_data.username,
|
||||
|
||||
Reference in new issue
Block a user