Merge pull request #1951 from normanjaeckel/Autoupdate
Fixed problem with some REST requests during autoupdate. Fixed #1935.
This commit is contained in:
commit
c40dfb120b
@ -188,7 +188,8 @@ angular.module('OpenSlidesApp.core', [
|
|||||||
}
|
}
|
||||||
DS.eject(data.collection, data.id);
|
DS.eject(data.collection, data.id);
|
||||||
}
|
}
|
||||||
// TODO: handle other statuscodes
|
// If you want to handle more status codes, change server
|
||||||
|
// restrictions in utils/autoupdate.py.
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
@ -79,14 +79,18 @@ class OpenSlidesSockJSConnection(SockJSConnection):
|
|||||||
This method is called after succesful response of AsyncHTTPClient().
|
This method is called after succesful response of AsyncHTTPClient().
|
||||||
See send_object().
|
See send_object().
|
||||||
"""
|
"""
|
||||||
collection, obj_id = get_collection_and_id_from_url(response.request.url)
|
if response.code in (200, 404):
|
||||||
data = {
|
# Only send something to the client in case of one of these status
|
||||||
'url': response.request.url,
|
# codes. You have to change the client code (autoupdate.onMessage)
|
||||||
'status_code': response.code,
|
# if you want to handle some more codes.
|
||||||
'collection': collection,
|
collection, obj_id = get_collection_and_id_from_url(response.request.url)
|
||||||
'id': obj_id,
|
data = {
|
||||||
'data': json.loads(response.body.decode())}
|
'url': response.request.url,
|
||||||
self.send(data)
|
'status_code': response.code,
|
||||||
|
'collection': collection,
|
||||||
|
'id': obj_id,
|
||||||
|
'data': json.loads(response.body.decode())}
|
||||||
|
self.send(data)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def send_object(cls, object_url):
|
def send_object(cls, object_url):
|
||||||
|
Loading…
Reference in New Issue
Block a user