Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded pydantic and fast api to last version. Fixed ORM mode and EmailStr imports #100

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from fastapi import APIRouter, Body, Depends, HTTPException
from fastapi.encoders import jsonable_encoder
from pydantic.types import EmailStr
from pydantic import EmailStr
from sqlalchemy.orm import Session

from app import crud
Expand Down Expand Up @@ -103,7 +103,7 @@ def create_user_open(
if not config.USERS_OPEN_REGISTRATION:
raise HTTPException(
status_code=403,
detail="Open user resgistration is forbidden on this server",
detail="Open user registration is forbidden on this server",
)
user = crud.user.get_by_email(db, email=email)
if user:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from fastapi import APIRouter, Depends
from pydantic.types import EmailStr
from pydantic import EmailStr

from app.api.utils.security import get_current_active_superuser
from app.core.celery_app import celery_app
Expand Down
3 changes: 3 additions & 0 deletions {{cookiecutter.project_slug}}/backend/app/app/models/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ class ItemBase(BaseModel):
title: str = None
description: str = None

class Config:
orm_mode = True


# Properties to receive on item creation
class ItemCreate(ItemBase):
Expand Down
3 changes: 3 additions & 0 deletions {{cookiecutter.project_slug}}/backend/app/app/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ class UserBase(BaseModel):
is_superuser: Optional[bool] = False
full_name: Optional[str] = None

class Config:
orm_mode = True


class UserBaseInDB(UserBase):
id: int = None
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.project_slug}}/backend/backend.dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.7

RUN pip install celery~=4.3 passlib[bcrypt] tenacity requests emails "fastapi>=0.16.0" uvicorn gunicorn pyjwt python-multipart email_validator jinja2 psycopg2-binary alembic SQLAlchemy
RUN pip install celery~=4.3 passlib[bcrypt] tenacity requests emails fastapi uvicorn gunicorn pyjwt python-multipart email_validator jinja2 psycopg2-binary alembic SQLAlchemy

# For development, Jupyter remote kernel, Hydrogen
# Using inside the container:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM python:3.7

RUN pip install raven celery~=4.3 passlib[bcrypt] tenacity requests "fastapi>=0.16.0" emails pyjwt email_validator jinja2 psycopg2-binary alembic SQLAlchemy
RUN pip install raven celery~=4.3 passlib[bcrypt] tenacity requests fastapi emails pyjwt email_validator jinja2 psycopg2-binary alembic SQLAlchemy

# For development, Jupyter remote kernel, Hydrogen
# Using inside the container:
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.project_slug}}/backend/tests.dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM python:3.7

RUN pip install requests pytest tenacity passlib[bcrypt] "fastapi>=0.16.0" psycopg2-binary SQLAlchemy
RUN pip install requests pytest tenacity passlib[bcrypt] fastapi psycopg2-binary SQLAlchemy

# For development, Jupyter remote kernel, Hydrogen
# Using inside the container:
Expand Down