0.0.41
create route by form
This commit is contained in:
@@ -41,11 +41,18 @@ def create_route_ajax(request):
|
||||
html = render_to_string('blocks/profile/b_new_route.html', Dict, request=request)
|
||||
return JsonResponse({'html': html}, status=400)
|
||||
|
||||
obj = form.save(commit=False)
|
||||
obj.owner = request.user
|
||||
obj.save()
|
||||
|
||||
|
||||
routes = Route.objects.filter(owner=request.user)
|
||||
Dict = {
|
||||
'routes': routes
|
||||
}
|
||||
html = render_to_string('blocks/profile/b_my_routes.html', Dict, request=request)
|
||||
|
||||
res_Dict = {
|
||||
'html': '!!!'
|
||||
'html': html
|
||||
}
|
||||
|
||||
return JsonResponse(res_Dict)
|
||||
|
||||
Reference in New Issue
Block a user