summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-12-28 16:22:23 +0100
committerDan McGee <dan@archlinux.org>2012-12-28 21:48:29 +0100
commit2ff967c3d9433361b1f086c326f3a473f10373e3 (patch)
tree4c657663af832757559629e036718f97c323bfda
parentc8ece67cec9c421ac0c711554edd34f022623b45 (diff)
downloadarchweb-2ff967c3d9433361b1f086c326f3a473f10373e3.tar.gz
archweb-2ff967c3d9433361b1f086c326f3a473f10373e3.tar.xz
Todolist URLs map to old_id now, not id
This is a short-term fix before adding a slug field to todo lists as we did to news a while back. Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--todolists/models.py2
-rw-r--r--todolists/views.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/todolists/models.py b/todolists/models.py
index c38c564..d19ad92 100644
--- a/todolists/models.py
+++ b/todolists/models.py
@@ -34,7 +34,7 @@ class Todolist(models.Model):
return self.name
def get_absolute_url(self):
- return '/todo/%i/' % self.id
+ return '/todo/%i/' % self.old_id
def get_full_url(self, proto='https'):
'''get a URL suitable for things like email including the domain'''
diff --git a/todolists/views.py b/todolists/views.py
index 9416439..ccf6536 100644
--- a/todolists/views.py
+++ b/todolists/views.py
@@ -35,7 +35,7 @@ class TodoListForm(forms.ModelForm):
@permission_required('todolists.change_todolistpackage')
@never_cache
def flag(request, list_id, pkg_id):
- todolist = get_object_or_404(Todolist, id=list_id)
+ todolist = get_object_or_404(Todolist, old_id=list_id)
tlpkg = get_object_or_404(TodolistPackage, id=pkg_id)
# TODO: none of this; require absolute value on submit
if tlpkg.status == TodolistPackage.INCOMPLETE:
@@ -53,7 +53,7 @@ def flag(request, list_id, pkg_id):
@login_required
def view(request, list_id):
- todolist = get_object_or_404(Todolist, id=list_id)
+ todolist = get_object_or_404(Todolist, old_id=list_id)
svn_roots = Repo.objects.values_list(
'svn_root', flat=True).order_by().distinct()
# we don't hold onto the result, but the objects are the same here,
@@ -71,7 +71,7 @@ def view(request, list_id):
# really no need for login_required on this one...
def list_pkgbases(request, list_id, svn_root):
'''Used to make bulk moves of packages a lot easier.'''
- todolist = get_object_or_404(Todolist, id=list_id)
+ todolist = get_object_or_404(Todolist, old_id=list_id)
repos = get_list_or_404(Repo, svn_root=svn_root)
pkgbases = TodolistPackage.objects.values_list('pkgbase', flat=True).filter(
todolist=todolist, repo__in=repos).distinct().order_by('pkgbase')
@@ -107,7 +107,7 @@ def add(request):
@permission_required('todolists.change_todolist')
@never_cache
def edit(request, list_id):
- todo_list = get_object_or_404(Todolist, id=list_id)
+ todo_list = get_object_or_404(Todolist, old_id=list_id)
if request.POST:
form = TodoListForm(request.POST, instance=todo_list)
if form.is_valid():