From 3ddad23057cb6240bb8952f4ed89891d36dd1126 Mon Sep 17 00:00:00 2001 From: dim web Date: Mon, 8 Nov 2021 00:51:18 +0300 Subject: [PATCH] ignore mobile_app folder --- .gitignore | 5 ++++- server/main/english_learn/select_learn/api/views.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 543b3a9..4f7f00f 100644 --- a/.gitignore +++ b/.gitignore @@ -206,4 +206,7 @@ target/ __pycache__/ local_settings.py eng_env/ -.env \ No newline at end of file +.env + +## Custom Files +mobile_app/* \ No newline at end of file diff --git a/server/main/english_learn/select_learn/api/views.py b/server/main/english_learn/select_learn/api/views.py index 1e24d0f..ebd7d70 100644 --- a/server/main/english_learn/select_learn/api/views.py +++ b/server/main/english_learn/select_learn/api/views.py @@ -36,7 +36,8 @@ def get(self, request): user_id = request.user.id sql_str = f"""select * from public.select_learn_userword where ('2.72'::real ^ -((SELECT EXTRACT(epoch FROM (now() - updated_at::timestamptz)))/3600::real / strength)) < 0.5 - and user_id = {user_id} or trials = 0 and user_id = {user_id} limit 20;""" + and user_id = {user_id} or + trials = 0 and user_id = {user_id} limit 20;""" words = UserWord.objects.raw(sql_str) # print(words) words = UserWordSerializer(words, many=True).data