Skip to content

Commit

Permalink
Merge pull request #52 from fotochest/bug/fix_new_album
Browse files Browse the repository at this point in the history
Fix for not being able to add an album on a child album page
  • Loading branch information
dstegelman committed Dec 18, 2011
2 parents 59e0bee + af85d5f commit 65c45c3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ settings/production.py
settings/staging.py
dev.db
uploads
.idea/
11 changes: 11 additions & 0 deletions apps/photo_manager/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,17 @@ def child_albums(request, user_name, parent_album_slug):
parent_album = Album.objects.get(slug=parent_album_slug, user=user)
albums = Album.objects.filter(parent_album=parent_album)
context = {'albums':albums, 'author': user}
if request.POST and request.user.is_authenticated():
form = AlbumForm(request.POST)
if form.is_valid():
album = form.save(commit=False)
album.user = request.user
album.save()
else:
context['album_form'] = AlbumForm()
return render(request, "smugmug/albums.html", context)
'''
def homepage(request, username=None):
Expand Down

0 comments on commit 65c45c3

Please sign in to comment.