Selaa lähdekoodia

HUE-9000 [editor] Clearing Editor history is erroring

To prevent:

Traceback (most recent call last):
  File "/home/romain/projects/hue/desktop/libs/notebook/src/notebook/decorators.py", line 111, in wrapper
    return f(*args, **kwargs)
  File "/home/romain/projects/hue/desktop/libs/notebook/src/notebook/decorators.py", line 100, in decorate
    return view_func(request, *args, **kwargs)
  File "/home/romain/projects/hue/desktop/libs/notebook/src/notebook/api.py", line 570, in clear_history
    notebook = json.loads(request.POST.get('notebook'), '{}')
TypeError: loads() takes 1 positional argument but 2 were given
Romain 6 vuotta sitten
vanhempi
commit
c609a98c8f

+ 1 - 0
desktop/core/src/desktop/js/api/apiHelper.js

@@ -1936,6 +1936,7 @@ class ApiHelper {
     return this.simplePost('/notebook/api/close_session', data, options);
   }
 
+  // Used by check history status
   checkStatus(options) {
     const data = {
       notebook: options.notebookJson

+ 1 - 1
desktop/libs/notebook/src/notebook/api.py

@@ -566,7 +566,7 @@ def get_history(request):
 def clear_history(request):
   response = {'status': -1}
 
-  notebook = json.loads(request.POST.get('notebook'), '{}')
+  notebook = json.loads(request.POST.get('notebook', '{}'))
   doc_type = request.POST.get('doc_type')
   is_notification_manager = request.POST.get('is_notification_manager', 'false') == 'true'