@@ -153,6 +153,24 @@ async def project_topic(update, context):
153153 return CHECK_REPOSITORIO
154154
155155
156+ async def save_project (username , chat_id , context ):
157+ '''Save project to database'''
158+ new_project = current_projects [username ]
159+
160+ try :
161+ new_project .save ()
162+ except peewee .IntegrityError :
163+ await context .bot .send_message (
164+ chat_id = chat_id ,
165+ text = "Ups ese proyecto ya fue cargado"
166+ )
167+ else :
168+ await context .bot .send_message (
169+ chat_id = chat_id ,
170+ text = "Tu proyecto ha sido cargado"
171+ )
172+
173+
156174async def ask_if_repository_exists (update , context ):
157175 '''Dialog to ask if a repository exists'''
158176 callback_query = update .callback_query
@@ -173,24 +191,6 @@ async def ask_if_repository_exists(update, context):
173191 return ConversationHandler .END
174192
175193
176- async def save_project (username , chat_id , context ):
177- '''Save project to database'''
178- new_project = current_projects [username ]
179-
180- try :
181- new_project .save ()
182- except peewee .IntegrityError :
183- await context .bot .send_message (
184- chat_id = chat_id ,
185- text = "Ups ese proyecto ya fue cargado"
186- )
187- else :
188- await context .bot .send_message (
189- chat_id = chat_id ,
190- text = "Tu proyecto ha sido cargado"
191- )
192-
193-
194194async def project_repository (update , context ):
195195 '''Dialog to set project repository'''
196196 username = update .message .from_user .username
@@ -253,7 +253,6 @@ async def ask_repository_name(update, context):
253253 return 2
254254
255255
256- @active_needed
257256async def add_repository (update , context ):
258257 '''Dialog to set repository'''
259258 username = update .message .from_user .username
0 commit comments