Xqt has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1305952?usp=email )
Change subject: [bugfix] Ensure -summary option overrides default summary
setting
......................................................................
[bugfix] Ensure -summary option overrides default summary setting
Previously, the -summary option was only applied if it was specified
before the generator option. Now, -summary always takes precedence
over the default summary setting, even if it is specified after the
generator option.
Bug: T192044
Change-Id: Iacc261783d1cc1c17022c1f86373292fef190b60
---
M scripts/protect.py
1 file changed, 5 insertions(+), 3 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/scripts/protect.py b/scripts/protect.py
index 6e490d0..33ee83a 100755
--- a/scripts/protect.py
+++ b/scripts/protect.py
@@ -198,14 +198,16 @@
elif option in protection_types and value:
protections[option] = value
else:
+ # specify generator
if not gen_factory.handle_arg(arg):
raise ValueError(f'Unknown parameter "{arg}"')
+
+ generator_type = option
if value:
message_properties.update({'cat': value, 'page': value})
- if 'summary' not in options:
- generator_type = option
- if generator_type in default_summaries:
+ # get default summary message
+ if 'summary' not in options and generator_type in default_summaries:
message_type = default_summaries[generator_type]
if message_type == 'simple' or message_properties:
if default_level == 'all':
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1305952?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Iacc261783d1cc1c17022c1f86373292fef190b60
Gerrit-Change-Number: 1305952
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Ivan-r <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]