Skip to content

Commit

Permalink
reformat files
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduard0803 committed Nov 25, 2023
1 parent 88744aa commit e58b83f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
16 changes: 12 additions & 4 deletions gestao/db/migrations/versions/2023-11-25-07-13_89f33fa986f8.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,19 @@


# revision identifiers, used by Alembic.
revision = '89f33fa986f8'
down_revision = '0084e7dffc7c'
revision = "89f33fa986f8"
down_revision = "0084e7dffc7c"
branch_labels = None
depends_on = None


def upgrade() -> None:
with op.batch_alter_table("user") as batch_op:
batch_op.alter_column('mother_date', new_column_name='mother_name', existing_type=sa.String(length=200))
batch_op.alter_column(
"mother_date",
new_column_name="mother_name",
existing_type=sa.String(length=200),
)
batch_op.add_column(
sa.Column("password", sa.String(200), nullable=True),
)
Expand All @@ -29,6 +33,10 @@ def upgrade() -> None:

def downgrade() -> None:
with op.batch_alter_table("user") as batch_op:
batch_op.alter_column('mother_name', new_column_name='mother_date', existing_type=sa.String(length=200))
batch_op.alter_column(
"mother_name",
new_column_name="mother_date",
existing_type=sa.String(length=200),
)
batch_op.drop_column("password")
batch_op.drop_column("religion")
9 changes: 5 additions & 4 deletions gestao/web/api/login/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
router = APIRouter()


@router.post('/user')
@router.post("/user")
async def login_user(login_data: AuthUserDTO) -> User:
try:
return await User.objects.select_related(User.dependents).get(**login_data.dict())
return await User.objects.select_related(User.dependents).get(
**login_data.dict()
)
except Exception:
logging.error("User not found", exc_info=True)
raise HTTPException(
status_code=404,
detail='User not found',
detail="User not found",
)

0 comments on commit e58b83f

Please sign in to comment.