Answer the question
In order to leave comments, you need to log in
How to check if an action was performed today?
Tell me, please, how can I check if a certain action was performed during the current day?
The code:
def get_messages_template(request) -> HttpResponse:
if not request.user.is_authenticated:
return HttpResponseForbidden()
tmpl_text = ''
tmpl_id = id_cleaner(request.POST.get('template_id', ''))
try:
obj = MessageTemplate.objects.get(pk=tmpl_id)
tmpl_text = obj.text
except Exception:
traceback.print_exc()
return JsonResponse({'success': True, 'template': tmpl_text})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question