-
Notifications
You must be signed in to change notification settings - Fork 0
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
banMacros default value "" str incompatible with usages assuming dict #8
Comments
Same thing with removal reasons and mod macros. I was able to fix this on my end by creating a dummy removal reason header text, then removing it; creating a dummy mod macro, then removing it; and finally creating a dummy ban macro, then removing it. When looking at the diff we can see that those parts were initialized by the adding then removing causing them to be dictionaries as expected rather than strings: {
"ver": 1,
"domainTags": "",
- "removalReasons": "",
+ "removalReasons": {
+ "pmsubject": "",
+ "logreason": "",
+ "header": "",
+ "footer": "",
+ "removalOption": "suggest",
+ "typeReply": "reply",
+ "typeStickied": false,
+ "typeCommentAsSubreddit": false,
+ "typeLockComment": false,
+ "typeAsSub": false,
+ "autoArchive": false,
+ "typeLockThread": false,
+ "logsub": "",
+ "logtitle": "",
+ "bantitle": "",
+ "getfrom": "",
+ "reasons": []
+ },
- "modMacros": "",
+ "modMacros": [],
...
- "banMacros": ""
+ "banMacros": {
+ "banNote": "",
+ "banMessage": ""
+ }
} |
Hey there! Apologies for the late reply here. Currently pmtw mirrors the setup created by toolbox, which does initialize those as blank strings. It looks like it should be fine to initialize them as empty lists, so as soon as I've got a chance to make sure that doesn't make anything misbehave I'll patch that! Also, I'm super glad to know pmtw's getting some use! |
Fix for #8. Needs Testing before committing.
Same issue here. Just making the change in #10 didn't fix the issue; I still got:
I had a config page that looks like this:
Following the steps suggested by @HaydenElza fixed it. |
For starters, many thanks for offering this library! It's great :) (and used here by me)
Exception when banMacros isn't defined in toolbox config. This can be resolved user-end by defining a ban macro, but could be improved here
banMacros init'd to "" if doesn't exist:
banMacros passed to from_dist with "" if didn't exist:
"".get() no bueno:
https://github.com/adhesivecheese/pmtw/blob/main/pmtw/settings.py#L27
Logs:
The text was updated successfully, but these errors were encountered: