0.1.6
edit route url
This commit is contained in:
13
ChatServiceApp/js_urls.py
Normal file
13
ChatServiceApp/js_urls.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# coding=utf-8
|
||||
from django.urls import path
|
||||
# from AuthApp.js_views import *
|
||||
# from AuthApp.import_funcs import *
|
||||
from .js_views import *
|
||||
from django.contrib.auth import views
|
||||
from RoutesApp.js_views import new_route_view_ajax
|
||||
|
||||
urlpatterns = [
|
||||
path('support_create_ticket_ajax/', support_create_ticket_ajax, name='support_create_ticket_ajax'),
|
||||
# path('create_/', registration_ajax, name='registration_ajax'),
|
||||
|
||||
]
|
||||
27
ChatServiceApp/js_views.py
Normal file
27
ChatServiceApp/js_views.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
from uuid import uuid1
|
||||
from .models import *
|
||||
from django.contrib import auth
|
||||
from django.http import HttpResponse, Http404, JsonResponse
|
||||
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 django.template.loader import render_to_string
|
||||
from django.urls import reverse
|
||||
|
||||
@login_required(login_url='/profile/login/')
|
||||
def support_create_ticket_ajax(request):
|
||||
from ChatServiceApp.forms import CreateTicketForm
|
||||
|
||||
if request.method != 'POST':
|
||||
raise Http404
|
||||
|
||||
Dict = {
|
||||
'forms': CreateTicketForm()
|
||||
}
|
||||
|
||||
html = render_to_string('blocks/profile/b_create_ticket.html', Dict, request=request)
|
||||
return JsonResponse({'html': html}, status=200)
|
||||
Reference in New Issue
Block a user