Skip to content
Open
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
2 changes: 1 addition & 1 deletion tg_routine/commandHelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,5 @@ def write_specific_helper(message: str, from_label: str, chat=None, chat_id=None
response = f"""Message from {from_label}:
{message}"""
# ToDo: use labels, add english and russian translations with appropriate label to /helpers/translationHelper.py. Use get_label("text")

print(response)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove prints from final commits

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_label("labelname", chat.language)

return response, chat_id
5 changes: 3 additions & 2 deletions website/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from django.http import JsonResponse, HttpResponse
from django.views import View

from tg_routine.commandHelpers import *
from tg_routine.commandHelpers import write_specific_helper
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from tg_routine.commandHelpers import *

Means that everything will be imported from the commandHelpers, no need to change that

from tg_routine.commandHelpers import all_users_balance_helper
from tg_routine.main import telegram_async_handler


Expand Down Expand Up @@ -77,7 +78,7 @@ def insert_message(request, *args, **kwargs):
def test_endpoint(request, *args, **kwargs):
if request.method == "GET":
results = all_users_balance_helper() # ToDo: for test purposes only change here.
# response, chat_id = write_specific_helper(message, from_label, chat_id=12345) # ToDo: use if there are multiple outputs
result, chat_id = write_specific_helper("message", "from_label", chat_id=12345) # ToDo: use if there are multiple outputs
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to change the test endpoint

print(results)
return JsonResponse({"test": results})
else:
Expand Down