Skip to content

Commit 4ae4ecc

Browse files
committed
Minor changes related to show_my_projects command
1 parent 115a643 commit 4ae4ecc

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/pycamp_bot/commands/projects.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ async def show_projects(update, context):
258258
async def show_my_projects(update, context):
259259
"""Let people see what projects they have voted for"""
260260

261-
user_id = Pycampista.get(Pycampista.username == update.message.from_user.username)
262-
votes = Vote.select(Project, Slot).join(Project).join(Slot).where((Vote.pycampista == user_id) & Vote.interest).order_by(Slot.code)
261+
user = Pycampista.get(Pycampista.username == update.message.from_user.username)
262+
votes = Vote.select(Project, Slot).join(Project).join(Slot).where((Vote.pycampista == user) & Vote.interest).order_by(Slot.code)
263263

264264
if votes:
265265
text_chunks = []
@@ -273,13 +273,13 @@ async def show_my_projects(update, context):
273273
if slot_day_code != prev_slot_day_code:
274274
text_chunks.append(f'*{slot_day_name}*')
275275

276-
slot_start_time = str(vote.project.slot.start) + ':00'
277-
project_text = "{}\n{}\nOwner: @{}".format(
278-
slot_start_time,
276+
project_lines = [
277+
f'{vote.project.slot.start}:00',
279278
vote.project.name,
280-
vote.project.owner.username,
281-
)
282-
text_chunks.append(project_text)
279+
f'Owner: @{vote.project.owner.username}',
280+
]
281+
282+
text_chunks.append('\n'.join(project_lines))
283283

284284
prev_slot_day_code = slot_day_code
285285

0 commit comments

Comments
 (0)