API - init OAuth server and oauth clients creation

This commit is contained in:
Sam
2022-05-27 13:28:26 +02:00
parent c13e9e0286
commit c6cd7ff67c
19 changed files with 700 additions and 1 deletions

View File

@ -111,6 +111,9 @@ class User(BaseModel):
new_password, current_app.config.get('BCRYPT_LOG_ROUNDS')
).decode()
def get_user_id(self) -> int:
return self.id
@hybrid_property
def workouts_count(self) -> int:
return Workout.query.filter(Workout.user_id == self.id).count()