|
|
@@ -9,6 +9,7 @@ from django.db.models.signals import post_save
|
|
9
|
9
|
from django.dispatch import receiver
|
|
10
|
10
|
from django.db.utils import IntegrityError
|
|
11
|
11
|
from django.conf import settings
|
|
|
12
|
+from counter.views.counter import reset_counter
|
|
12
|
13
|
|
|
13
|
14
|
import json
|
|
14
|
15
|
import requests
|
|
|
@@ -158,8 +159,12 @@ def webhook(request):
|
|
158
|
159
|
except Counter.DoesNotExist:
|
|
159
|
160
|
yes_counter = telegram_user.counter
|
|
160
|
161
|
seum_message = m
|
|
161
|
|
- reset = Reset(counter=yes_counter, who=telegram_user.counter, reason=seum_message)
|
|
162
|
|
- reset.save()
|
|
|
162
|
+
|
|
|
163
|
+ reset_counter({
|
|
|
164
|
+ 'who': telegram_ser.counter.id,
|
|
|
165
|
+ 'reason': seum_message,
|
|
|
166
|
+ 'counter': yes_counter.id
|
|
|
167
|
+ })
|
|
163
|
168
|
except TelegramUser.DoesNotExist:
|
|
164
|
169
|
print('in that case we send a link to the user')
|
|
165
|
170
|
if chat['type'] == 'private' and chat['id'] == telegram_user_id:
|