Skip to content

Commit 961f481

Browse files
committed
fix invalid char. route fix.
1 parent f3d32a8 commit 961f481

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

fileupload/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Picture(models.Model):
1212
slug = models.SlugField(max_length=50, blank=True)
1313

1414
def __unicode__(self):
15-
return '%s' % (self.file)
15+
return self.file.name
1616

1717
@models.permalink
1818
def get_absolute_url(self):

urls.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from django.conf.urls.defaults import patterns, include, url
2-
from django.shortcuts import redirect
2+
from django.http import HttpResponseRedirect
33

44
# Uncomment the next two lines to enable the admin:
55
from django.contrib import admin
@@ -9,8 +9,7 @@
99
# Examples:
1010
# url(r'^$', 'upload.views.home', name='home'),
1111

12-
13-
url(r'^$', redirect(‘url-name’)),
12+
url(r'^$', lambda x: HttpResponseRedirect('/upload/new/')),
1413
url(r'^upload/', include('fileupload.urls')),
1514

1615
# Uncomment the admin/doc line below to enable admin documentation:

0 commit comments

Comments
 (0)