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
24 changes: 24 additions & 0 deletions migrations/migrate_to_repository_and_group_urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# https://docs.peewee-orm.com/en/latest/peewee/playhouse.html#schema-migrations

import peewee
import playhouse.migrate

import pycamp_bot.models


my_db = peewee.SqliteDatabase('pycamp_projects.db')
migrator = playhouse.migrate.SqliteMigrator(my_db)


playhouse.migrate.migrate(
migrator.add_column(
pycamp_bot.models.Project._meta.table_name,
'repository_url',
pycamp_bot.models.Project.repository_url,
),
migrator.add_column(
pycamp_bot.models.Project._meta.table_name,
'group_url',
pycamp_bot.models.Project.group_url,
),
)
13 changes: 8 additions & 5 deletions src/pycamp_bot/commands/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
from pycamp_bot.commands.help_msg import get_help
from pycamp_bot.logger import logger

import os


async def msg_to_active_pycamp_chat(bot, text):
chat_id = -1001404878013 # Prueba
await bot.send_message(
chat_id=chat_id,
text=text
)
if 'TEST_CHAT_ID' in os.environ:
chat_id = -1001404878013 # Prueba
await bot.send_message(
chat_id=os.environ['TEST_CHAT_ID'],
text=text
)


async def start(update, context):
Expand Down
1 change: 1 addition & 0 deletions src/pycamp_bot/commands/manage_pycamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ async def define_duration(update, context):
chat_id=update.message.chat_id,
text=msg
)
return ConversationHandler.END


async def cancel(update, context):
Expand Down
Loading