refactor/improve /editor/finalize with more JS and REST
This commit is contained in:
parent
dcda6c1891
commit
6753907df5
14 changed files with 289 additions and 165 deletions
12
src/c3nav/api/authentication.py
Normal file
12
src/c3nav/api/authentication.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
from rest_framework.authentication import SessionAuthentication
|
||||
|
||||
|
||||
class ForceCSRFCheckSessionAuthentication(SessionAuthentication):
|
||||
|
||||
def authenticate(self, request):
|
||||
result = super().authenticate(request)
|
||||
|
||||
if result is None:
|
||||
self.enforce_csrf(request)
|
||||
|
||||
return result
|
|
@ -1,7 +1,7 @@
|
|||
from django.conf.urls import include, url
|
||||
from rest_framework.routers import DefaultRouter
|
||||
|
||||
from c3nav.editor.api import HosterViewSet
|
||||
from c3nav.editor.api import HosterViewSet, SubmitTaskViewSet
|
||||
from c3nav.mapdata.api import FeatureTypeViewSet, FeatureViewSet, LevelViewSet, PackageViewSet, SourceViewSet
|
||||
|
||||
router = DefaultRouter()
|
||||
|
@ -11,6 +11,7 @@ router.register(r'sources', SourceViewSet)
|
|||
router.register(r'featuretypes', FeatureTypeViewSet, base_name='featuretype')
|
||||
router.register(r'features', FeatureViewSet)
|
||||
router.register(r'hosters', HosterViewSet, base_name='hoster')
|
||||
router.register(r'submittask', SubmitTaskViewSet, base_name='submittask')
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue