diff --git a/pastebin/apps/dpaste/admin.py b/pastebin/apps/dpaste/admin.py deleted file mode 100644 index ff59335..0000000 --- a/pastebin/apps/dpaste/admin.py +++ /dev/null @@ -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) \ No newline at end of file diff --git a/pastebin/apps/dpaste/views.py b/pastebin/apps/dpaste/views.py index 070e509..dba6fd4 100644 --- a/pastebin/apps/dpaste/views.py +++ b/pastebin/apps/dpaste/views.py @@ -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'))) diff --git a/pastebin/conf/settings.py b/pastebin/conf/settings.py index dedbd6f..1ef2e63 100644 --- a/pastebin/conf/settings.py +++ b/pastebin/conf/settings.py @@ -96,7 +96,6 @@ INSTALLED_APPS = ( 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', - 'django.contrib.admin', 'django.contrib.staticfiles', 'mptt', 'pastebin', diff --git a/pastebin/conf/urls.py b/pastebin/conf/urls.py index a6d89ad..311d5ad 100644 --- a/pastebin/conf/urls.py +++ b/pastebin/conf/urls.py @@ -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[^/]+)/$', snippet_resource), url(r'^api/$', snippet_resource), ) -urlpatterns += staticfiles_urlpatterns()