equal
deleted
inserted
replaced
51 def __init__(self, reason=''): |
51 def __init__(self, reason=''): |
52 super(RequestError, self).__init__() |
52 super(RequestError, self).__init__() |
53 self.reason = reason |
53 self.reason = reason |
54 |
54 |
55 def dumps(self): |
55 def dumps(self): |
56 try: |
56 from cubicweb.web import json |
57 from json import dumps |
57 return json.dumps({'reason': self.reason}) |
58 except ImportError: |
|
59 from simplejson import dumps |
|
60 return dumps({'reason': self.reason}) |
|
61 |
58 |
62 class LogOut(PublishException): |
59 class LogOut(PublishException): |
63 """raised to ask for deauthentication of a logged in user""" |
60 """raised to ask for deauthentication of a logged in user""" |
64 def __init__(self, url): |
61 def __init__(self, url): |
65 super(LogOut, self).__init__() |
62 super(LogOut, self).__init__() |