stc

a simple time card webapp
git clone _git@git.brennen.work:stc.git
Log | Files | Refs | README

commit 71a1d6fc16fcb305f067195ebdf9d0037b90249c
parent a8beaf4042767c6c308c641b8ba04213c0a57a13
Author: Nikolas Mazur <nikolas@pop-os.localdomain>
Date:   Wed, 18 Jan 2023 18:32:32 -0700

Remove password check in database

Diffstat:
Mmodels.py | 25++++++++-----------------
1 file changed, 8 insertions(+), 17 deletions(-)

diff --git a/models.py b/models.py @@ -4,7 +4,7 @@ # fixed datetime import datetime -from flask import Flask, jsonify +from flask import Flask, jsonify, request from fastapi.encoders import jsonable_encoder from typing import List, Optional @@ -13,11 +13,11 @@ from pydantic import BaseModel, Field, ValidationError, validator class Users: def signup(self): + print(request.form) users = { '_id': '', 'username': '', 'password': '', - 'confirm_password': '', 'role': '', 'location': '', 'phone': '', @@ -29,27 +29,18 @@ class Users: return jsonify(users), 200 - def to_json(self): - return jsonable_encoder(self, exclude_none=True) - - def to_bson(self): - data = self.dict(by_alias=True, exclude_none=True) - - if data["_id"] is None: - data.pop("_id") - return data + def login(self): + user = { + 'username': '', + 'password': '', + 'confirm_password': '', + } @validator('username') def username_alphanumeric(cls, v): assert v.isalnum(), 'Username must be alphanumeric' return v - @validator('confirm_password') - def password_confirmed(cls, v, values, **kwargs): - if 'password' in values and v != values['password']: - raise ValueError('Passwords do not match') - return v - class Time: def clockin(self):