mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Redirect non-ajax forms to /
This commit is contained in:
parent
080f9da9c8
commit
f4a052ee2b
@ -9,7 +9,7 @@ as JSON objects and passing them to modal forms (using jQuery / bootstrap).
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.template.loader import render_to_string
|
from django.template.loader import render_to_string
|
||||||
from django.http import JsonResponse
|
from django.http import JsonResponse, HttpResponseRedirect
|
||||||
|
|
||||||
from django.views import View
|
from django.views import View
|
||||||
from django.views.generic import UpdateView, CreateView
|
from django.views.generic import UpdateView, CreateView
|
||||||
@ -132,6 +132,9 @@ class AjaxMixin(object):
|
|||||||
JSON response object
|
JSON response object
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if not request.is_ajax():
|
||||||
|
return HttpResponseRedirect('/')
|
||||||
|
|
||||||
if context is None:
|
if context is None:
|
||||||
try:
|
try:
|
||||||
context = self.get_context_data()
|
context = self.get_context_data()
|
||||||
|
@ -36,7 +36,7 @@ stock_urls = [
|
|||||||
|
|
||||||
url(r'^track/?', views.StockTrackingIndex.as_view(), name='stock-tracking-list'),
|
url(r'^track/?', views.StockTrackingIndex.as_view(), name='stock-tracking-list'),
|
||||||
|
|
||||||
url(r'^move/', views.StockItemMoveMultiple.as_view(), name='stock-item-move-multiple'),
|
url(r'^move/?', views.StockItemMoveMultiple.as_view(), name='stock-item-move-multiple'),
|
||||||
|
|
||||||
# Individual stock items
|
# Individual stock items
|
||||||
url(r'^item/(?P<pk>\d+)/', include(stock_item_detail_urls)),
|
url(r'^item/(?P<pk>\d+)/', include(stock_item_detail_urls)),
|
||||||
|
Loading…
Reference in New Issue
Block a user