ming преди 3 години
родител
ревизия
ebf269e028
променени са 4 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. BIN
      api/__pycache__/main.cpython-39.pyc
  2. 1 1
      api/main.py
  3. BIN
      api/util/__pycache__/models.cpython-39.pyc
  4. 1 0
      api/util/models.py

BIN
api/__pycache__/main.cpython-39.pyc


+ 1 - 1
api/main.py

@@ -238,7 +238,7 @@ async def login_for_access_token(request: Request, form_data: OAuth2PasswordRequ
     if util.user.email_veri_pass(form_data.username):
         return {"access_token": access_token, "token_type": "bearer",'veri':'ok'}
     else:
-        veri_obj = first(db.query('SELECT * FROM register_veri_code where user_id ="'+str(user_dict['id'])+'"'))
+        veri_obj = first(db.query('SELECT * FROM register_veri_code where user_id ="'+str(user.id)+'"'))
         mailer.register_verify('請至點擊網址驗證 : https://video.choozmo.com/verify_email.html?code='+veri_obj['code'], user.email)
         return {"access_token": access_token, "token_type": "bearer",'veri':'fail'}
 

BIN
api/util/__pycache__/models.cpython-39.pyc


+ 1 - 0
api/util/models.py

@@ -49,6 +49,7 @@ class Settings(BaseModel):
     authjwt_cookie_csrf_protect: bool = True
 
 class User(BaseModel):
+    id :int
     username: str
     email: str
     password: str