mirror of
https://github.com/DarrenOfficial/dpaste.git
synced 2024-12-23 23:23:06 +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
|
||||
|
||||
class SnippetHandler(AnonymousBaseHandler):
|
||||
allowed_methods = ('GET', 'POST')
|
||||
allowed_methods = ('POST',)
|
||||
fields = ('title', 'content',)
|
||||
model = Snippet
|
||||
|
||||
def read(self, request, secret_id):
|
||||
post = Snippet.objects.get(secret_id=secret_id)
|
||||
return post
|
||||
|
||||
def create(self, request):
|
||||
if not request.POST.get('content'):
|
||||
return rc.BAD_REQUEST
|
||||
|
|
|
@ -99,7 +99,6 @@ INSTALLED_APPS = (
|
|||
'django.contrib.admin',
|
||||
'django.contrib.staticfiles',
|
||||
'mptt',
|
||||
'piston',
|
||||
'pastebin',
|
||||
'pastebin.apps.dpaste',
|
||||
'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