Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Editing filters fails with Python3 #43

Open
vtoc opened this issue Sep 16, 2021 · 0 comments
Open

Editing filters fails with Python3 #43

vtoc opened this issue Sep 16, 2021 · 0 comments

Comments

@vtoc
Copy link

vtoc commented Sep 16, 2021

Editing filters is failing because the "oldname" variable gets send to client as "b'value'" instead of "value" and will never match. Decoding it as UTF-8 before sending it to the client, fixes it.

--- views.py.orig      2021-09-16 13:42:52.795112059 +0200
+++ views.py   2021-09-16 13:43:52.096202663 +0200
@@ -186,7 +186,7 @@
         )
 
     fset = sc.getscript(setname, format="fset")
-    fname = smart_bytes(fname)
+    fname = smart_bytes(fname).decode("utf-8")
     f = fset.getfilter(fname)
     form = build_filter_form_from_filter(request, fname, f)
     ctx = build_filter_ctx(ctx, form)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant