Skip to content
Merged
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
17 changes: 17 additions & 0 deletions .github/workflows/tests.yml → .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,20 @@ jobs:
cat pytest-coverage.txt
- name: Comment coverage
uses: coroo/pytest-coverage-commentator@v1.0.2
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.11
- uses: isort/isort-action@master
with:
requirementsFiles: "requirements.txt requirements.dev.txt"
- uses: psf/black@stable
- name: Comment if linting failed
if: ${{ failure() }}
uses: thollander/actions-comment-pull-request@v2
with:
message: |
:poop: Code linting failed, use `black` and `isort` to fix it.
12 changes: 9 additions & 3 deletions calendar_backend/models/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ class Credentials(BaseDbModel):
scope: Mapped[JSON] = mapped_column(JSON, nullable=False)
token: Mapped[JSON] = mapped_column(JSON, nullable=False)
create_ts: Mapped[datetime] = mapped_column(DateTime, nullable=False, default=datetime.utcnow)
update_ts: Mapped[datetime] = mapped_column(DateTime, nullable=False, default=datetime.utcnow, onupdate=datetime.utcnow)
update_ts: Mapped[datetime] = mapped_column(
DateTime, nullable=False, default=datetime.utcnow, onupdate=datetime.utcnow
)


class Direction(str, Enum):
Expand Down Expand Up @@ -174,7 +176,9 @@ class CommentLecturer(BaseDbModel):
text: Mapped[str] = mapped_column(String, nullable=False)
approve_status: Mapped[ApproveStatuses] = mapped_column(DbEnum(ApproveStatuses, native_enum=False), nullable=False)
create_ts: Mapped[datetime] = mapped_column(DateTime, nullable=False, default=datetime.utcnow())
update_ts: Mapped[datetime] = mapped_column(DateTime, nullable=False, default=datetime.utcnow(), onupdate=datetime.utcnow())
update_ts: Mapped[datetime] = mapped_column(
DateTime, nullable=False, default=datetime.utcnow(), onupdate=datetime.utcnow()
)
is_deleted: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False)

lecturer: Mapped[Lecturer] = relationship(
Expand All @@ -191,7 +195,9 @@ class CommentEvent(BaseDbModel):
text: Mapped[str] = mapped_column(String, nullable=False)
approve_status: Mapped[ApproveStatuses] = mapped_column(DbEnum(ApproveStatuses, native_enum=False), nullable=False)
create_ts: Mapped[datetime] = mapped_column(DateTime, nullable=False, default=datetime.utcnow())
update_ts: Mapped[datetime] = mapped_column(DateTime, nullable=False, default=datetime.utcnow(), onupdate=datetime.utcnow())
update_ts: Mapped[datetime] = mapped_column(
DateTime, nullable=False, default=datetime.utcnow(), onupdate=datetime.utcnow()
)
is_deleted: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False)

event: Mapped[Event] = relationship(
Expand Down
4 changes: 2 additions & 2 deletions calendar_backend/routes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
from .group import group_router as old_group_router # DEPRICATED TODO: Drop 2023-04-01
from .group.group import router as group_router
from .lecturer import (
lecturer_comment_review_router as old_lecturer_comment_review_router,
) # DEPRICATED TODO: Drop 2023-04-01
lecturer_comment_review_router as old_lecturer_comment_review_router, # DEPRICATED TODO: Drop 2023-04-01
)
from .lecturer import lecturer_comment_router as old_lecturer_comment_router # DEPRICATED TODO: Drop 2023-04-01
from .lecturer import lecturer_photo_router as old_lecturer_photo_router # DEPRICATED TODO: Drop 2023-04-01
from .lecturer import lecturer_router as old_lecturer_router # DEPRICATED TODO: Drop 2023-04-01
Expand Down
3 changes: 2 additions & 1 deletion migrations/versions/3948c45f9977_building_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
Create Date: 2023-03-20 16:42:54.345727

"""
from alembic import op
import sqlalchemy as sa
from alembic import op


# revision identifiers, used by Alembic.
revision = '3948c45f9977'
Expand Down
2 changes: 1 addition & 1 deletion migrations/versions/63263ee9e08e_fix_photo_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
Create Date: 2023-03-20 15:15:20.345969

"""
from alembic import op
import sqlalchemy as sa
from alembic import op


# revision identifiers, used by Alembic.
Expand Down
3 changes: 2 additions & 1 deletion migrations/versions/fe04c8baa5ab_fix_sa20.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
Create Date: 2023-03-20 18:10:29.098467

"""
from alembic import op
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql


# revision identifiers, used by Alembic.
revision = 'fe04c8baa5ab'
down_revision = '3948c45f9977'
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ skip-string-normalization = true
[tool.isort]
line_length = 120
multi_line_output = 3
profile = "black"
lines_after_imports = 2
include_trailing_comma = true

Expand Down