Skip to content

Commit

Permalink
black and flake8 formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
prabinoid committed Jan 13, 2025
1 parent 7a7871b commit 4605a06
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
9 changes: 6 additions & 3 deletions backend/api/teams/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def get(self):
team_members = (
TeamMembers.query.join(User, TeamMembers.user_id == User.id)
.join(Team, TeamMembers.team_id == Team.id)
.filter(TeamMembers.team_id == team_id, TeamMembers.active == False)
.filter(TeamMembers.team_id == team_id, ~TeamMembers.active)
.with_entities(
User.username.label("username"),
TeamMembers.joined_date.label("joined_date"),
Expand All @@ -422,7 +422,7 @@ def get(self):
if not team_members:
return {
"message": "No inactive members found for the specified team"
}, 404
}, 200

# Generate CSV in memory
csv_output = io.StringIO()
Expand All @@ -448,7 +448,10 @@ def get(self):
csv_output.getvalue(),
mimetype="text/csv",
headers={
"Content-Disposition": f"attachment; filename=join_requests_{team_id}_{datetime.now().strftime('%Y%m%d')}.csv"
"Content-Disposition": (
"attachment; filename=join_requests_"
f"{team_id}_{datetime.now().strftime('%Y%m%d')}.csv"
)
},
)
except Exception as e:
Expand Down
10 changes: 5 additions & 5 deletions migrations/versions/8e5144b55919_.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@


# revision identifiers, used by Alembic.
revision = '8e5144b55919'
down_revision = 'ecb6985693c0_'
revision = "8e5144b55919"
down_revision = "ecb6985693c0_"
branch_labels = None
depends_on = None


def upgrade():
op.add_column(
'team_members',
sa.Column('joined_date', sa.DateTime(), nullable=True)
"team_members", sa.Column("joined_date", sa.DateTime(), nullable=True)
)


def downgrade():
op.drop_column('team_members', 'joined_date')
op.drop_column("team_members", "joined_date")

0 comments on commit 4605a06

Please sign in to comment.