1.6.12 fix next package for my_routes
This commit is contained in:
@@ -10,7 +10,7 @@ from django.template import loader, RequestContext
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from BaseModels.mailSender import techSendMail
|
||||
from django.utils.translation import gettext as _
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timedelta
|
||||
from django.template.loader import render_to_string
|
||||
from django.urls import reverse
|
||||
from .forms import *
|
||||
@@ -41,14 +41,20 @@ def highlight_route_ajax(request):
|
||||
msg = _('Нет доступа к выделению')
|
||||
return JsonResponse({'errors': msg})
|
||||
|
||||
route.highlight_color = '#FF0000'
|
||||
route.save(update_fields=['highlight_color'])
|
||||
|
||||
from SubscribesApp.funcs import get_cur_user_subscribe
|
||||
user_subscribe = get_cur_user_subscribe(request.user)
|
||||
user_subscribe.used_route_highlight_count += 1
|
||||
user_subscribe.save(update_fields=['used_route_highlight_count'])
|
||||
|
||||
|
||||
route.highlight_color = '#FF0000'
|
||||
highlight_hours = user_subscribe.get_highlight_hours()
|
||||
route.highlight_end_DT = datetime.now() + timedelta(hours=highlight_hours)
|
||||
route.save(update_fields=['highlight_color', 'highlight_end_DT'])
|
||||
|
||||
|
||||
|
||||
Dict = {
|
||||
'route': route,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user