Merge branch 'master' of github.com:bartTC/dpaste.de

This commit is contained in:
Martin Mahner 2011-06-03 23:17:13 +02:00
commit b25f26ebbb
4 changed files with 2 additions and 22 deletions

View file

@ -1,14 +0,0 @@
from pastebin.apps.dpaste.models import Snippet, Spamword
from django.contrib import admin
class SnippetAdmin(admin.ModelAdmin):
list_display = (
'__unicode__',
'author',
'lexer',
'published',
'expires',
)
admin.site.register(Snippet, SnippetAdmin)
admin.site.register(Spamword)

View file

@ -125,7 +125,8 @@ def userprefs(request, template_name='dpaste/userprefs.html'):
def snippet_diff(request, template_name='dpaste/snippet_diff.html'):
if request.GET.get('a').isdigit() and request.GET.get('b').isdigit():
if request.GET.get('a') and request.GET.get('a').isdigit() \
and request.GET.get('b') and request.GET.get('b').isdigit():
try:
fileA = Snippet.objects.get(pk=int(request.GET.get('a')))
fileB = Snippet.objects.get(pk=int(request.GET.get('b')))

View file

@ -96,7 +96,6 @@ INSTALLED_APPS = (
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.staticfiles',
'mptt',
'pastebin',

View file

@ -1,7 +1,6 @@
from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from piston.resource import Resource
from pastebin.apps.api.handlers import SnippetHandler
@ -14,13 +13,8 @@ urlpatterns = patterns('',
# Static
url(r'^about/$', 'django.views.generic.simple.direct_to_template', {'template': 'about.html'}, name='about'),
# Bla
(r'^i18n/', include('django.conf.urls.i18n')),
(r'^admin/', include(admin.site.urls)),
# API
url(r'^api/(?P<secret_id>[^/]+)/$', snippet_resource),
url(r'^api/$', snippet_resource),
)
urlpatterns += staticfiles_urlpatterns()