mirror of
https://github.com/DarrenOfficial/dpaste.git
synced 2024-11-15 08:02:54 +11:00
More fixes
This commit is contained in:
parent
edf59865d6
commit
e71fdca4fd
3 changed files with 4 additions and 6 deletions
|
@ -5,14 +5,10 @@ from piston.handler import AnonymousBaseHandler
|
||||||
from pastebin.apps.dpaste.models import Snippet
|
from pastebin.apps.dpaste.models import Snippet
|
||||||
|
|
||||||
class SnippetHandler(AnonymousBaseHandler):
|
class SnippetHandler(AnonymousBaseHandler):
|
||||||
allowed_methods = ('GET', 'POST')
|
allowed_methods = ('POST',)
|
||||||
fields = ('title', 'content',)
|
fields = ('title', 'content',)
|
||||||
model = Snippet
|
model = Snippet
|
||||||
|
|
||||||
def read(self, request, secret_id):
|
|
||||||
post = Snippet.objects.get(secret_id=secret_id)
|
|
||||||
return post
|
|
||||||
|
|
||||||
def create(self, request):
|
def create(self, request):
|
||||||
if not request.POST.get('content'):
|
if not request.POST.get('content'):
|
||||||
return rc.BAD_REQUEST
|
return rc.BAD_REQUEST
|
||||||
|
|
|
@ -99,7 +99,6 @@ INSTALLED_APPS = (
|
||||||
'django.contrib.admin',
|
'django.contrib.admin',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
'mptt',
|
'mptt',
|
||||||
'piston',
|
|
||||||
'pastebin',
|
'pastebin',
|
||||||
'pastebin.apps.dpaste',
|
'pastebin.apps.dpaste',
|
||||||
'gunicorn',
|
'gunicorn',
|
||||||
|
|
3
pastebin/disable.py
Normal file
3
pastebin/disable.py
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
class DisableCSRF(object):
|
||||||
|
def process_request(self, request):
|
||||||
|
setattr(request, '_dont_enforce_csrf_checks', True)
|
Loading…
Reference in a new issue