Advertisement
Guest User

Untitled

a guest
Jun 30th, 2015
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. diff --git a/cornice/service.py b/cornice/service.py
  2. index 3e14681..ade2551 100644
  3. --- a/cornice/service.py
  4. +++ b/cornice/service.py
  5. @@ -216,7 +216,6 @@ class Service(object):
  6. def callback(context, name, ob):
  7. config = context.config.with_package(info.module)
  8. config.add_cornice_service(self)
  9. -
  10. info = venusian.attach(self, callback, category='pyramid',
  11. depth=depth)
  12.  
  13. @@ -530,15 +529,16 @@ def decorate_view(view, args, method):
  14. # location (if the view argument isn't a callable)
  15. ob = None
  16. view_ = view
  17. - if 'klass' in args and not callable(view):
  18. + if 'klass' in args:
  19. params = dict(request=request)
  20. if 'factory' in args and 'acl' not in args:
  21. params['context'] = request.context
  22. ob = args['klass'](**params)
  23. - if is_string(view):
  24. - view_ = getattr(ob, view.lower())
  25. - elif isinstance(view, _UnboundView):
  26. - view_ = view.make_bound_view(ob)
  27. + if not callable(view):
  28. + if is_string(view):
  29. + view_ = getattr(ob, view.lower())
  30. + elif isinstance(view, _UnboundView):
  31. + view_ = view.make_bound_view(ob)
  32.  
  33. # set data deserializer
  34. if 'deserializer' in args:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement