Skip to content

Commit

Permalink
Make ZoomableView support multiple inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
cnorthwood committed Nov 23, 2010
1 parent ff3c809 commit f5a3247
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions molly/utils/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,15 @@ class ZoomableView(BaseView):
default_zoom = None

def initial_context(self, request, *args, **kwargs):
context = super(ZoomableView, self).initial_context(request, *args, **kwargs)
try:
zoom = int(request.GET['zoom'])
except (KeyError, ValueError):
zoom = self.default_zoom
else:
zoom = min(max(10, zoom), 18)
return {
'zoom': zoom,
}
context['zoom'] = zoom
return context

# FIXME:
# Block rendering methods, from http://djangosnippets.org/942
Expand Down

0 comments on commit f5a3247

Please sign in to comment.