Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant