1.3.6 add unanswered_msgs_count to all responses

This commit is contained in:
SDE
2024-06-29 14:44:19 +03:00
parent 75258f1706
commit 0e184f0b87
12 changed files with 147 additions and 45 deletions

View File

@@ -30,6 +30,17 @@ def get_and_set_lang(request):
return lang
def get_add_to_ajax_response_Dict(user):
context_Dict = {}
from ChatServiceApp.funcs import get_unanswered_msgs_count_for_user
context_Dict.update({
'unanswered_msgs_count': get_unanswered_msgs_count_for_user(user)
})
return context_Dict
def get_inter_Dict(user):
@@ -51,7 +62,7 @@ def get_inter_Dict(user):
return Dict
def get_inter_http_respose(template_obj, context_Dict, request):
def get_inter_http_response(template_obj, context_Dict, request):
context_Dict.update(get_inter_Dict(request.user))
@@ -72,4 +83,9 @@ def get_inter_http_respose(template_obj, context_Dict, request):
# if text and title and not request.user.is_anonymous:
# send_push(user=request.user, title=title, text=text)
from ChatServiceApp.funcs import get_unanswered_msgs_count_for_user
context_Dict.update({
'unanswered_msgs_count': get_unanswered_msgs_count_for_user(request.user)
})
return HttpResponse(template_obj.render(context_Dict, request))