Skip to content

Commit

Permalink
make sure forms are always available (bug 588513)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Balogh committed Aug 18, 2010
1 parent c221681 commit ab16974
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apps/bandwagon/tests/test_views.py
Expand Up @@ -355,7 +355,7 @@ def test_admin(self, f):
args=['admin', 'pornstar'])
r = self.client.get(url, follow=True)
doc = pq(r.content)
eq_(doc('form h3').text(), 'Admin Settings')
assert 'Admin Settings' in doc('form h3').text()

r = self.client.post(url, dict(application=1, type=0), follow=True)
eq_(r.status_code, 200)
Expand All @@ -371,7 +371,7 @@ def test_delete_link(self):

r = self.client.get(url)
doc = pq(r.content)
eq_(len(doc('#collection-delete-link')), 1)
eq_(len(doc('#collection-delete-link')), 3)

self.login_regular()
r = self.client.get(url)
Expand Down
6 changes: 5 additions & 1 deletion apps/bandwagon/views.py
Expand Up @@ -324,6 +324,8 @@ def edit(request, collection, username, slug):
initial = dict(type=collection.type,
application=collection.application_id)
admin_form = forms.AdminForm(initial=initial)
else:
admin_form = None

data = dict(collection=collection,
form=form,
Expand Down Expand Up @@ -357,7 +359,8 @@ def edit_addons(request, collection, username, slug):
addons.append(ca.addon)

data = dict(collection=collection, username=username, slug=slug,
addons=addons, comments=comments)
addons=addons, comments=comments,
form=forms.CollectionForm(instance=collection))
return jingo.render(request, 'bandwagon/edit.html', data)


Expand Down Expand Up @@ -390,6 +393,7 @@ def edit_contributors(request, collection, username, slug):
reverse('collections.edit_contributors',
args=[username, slug]))

data['form'] = forms.CollectionForm(instance=collection)
return jingo.render(request, 'bandwagon/edit.html', data)


Expand Down

0 comments on commit ab16974

Please sign in to comment.