Skip to content

Commit c8af2fd

Browse files
committed
Polish code
1 parent 203744d commit c8af2fd

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/pycamp_bot/commands/projects.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,17 @@ async def delete_project(update, context):
452452
async def show_projects(update, context):
453453
"""Show available projects"""
454454
projects = Project.select()
455+
PROJECT_FIELDS = [
456+
'*{}*',
457+
'Owner: @{}',
458+
'Temática: {}',
459+
'Nivel: {}',
460+
'Repositorio: {}',
461+
'Grupo de Telegram: {}',
462+
]
455463
text = []
456464
for project in projects:
457-
project_text = "*{}*\n Owner: @{}\n Temática: {}\n Nivel: {}\n Repositorio: {}\n Grupo de Telegram: {}".format(
465+
project_text = '\n'.join(PROJECT_FIELDS).format(
458466
escape_markdown(project.name),
459467
escape_markdown(project.owner.username),
460468
escape_markdown(project.topic),

0 commit comments

Comments
 (0)