Page MenuHomePhabricator

Provide an option to auto-create account on a first log-in to a local wiki under SUL
Closed, ResolvedPublic

Description

It appears that Pywikibot does not support auto-creation of local accounts under SUL. Auto-creation happens on someone's first visit to a SUL-connected wiki when they have a global account. It's apparently supported by MediaWiki API, too.

Could login.py support auto-creation?

Currently, when I try to log in to a new SUL-connected wiki, it will result in NoUsername:

Traceback (most recent call last):
  File "pwb.py", line 264, in <module>
    if not main():
  File "pwb.py", line 257, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "pwb.py", line 121, in run_python_file
    main_mod.__dict__)
  File "./scripts/login.py", line 190, in <module>
    main()
  File "./scripts/login.py", line 173, in main
    site.login(sysop)
  File "/tmp/pywikibot-core/pywikibot/site.py", line 2091, in login
    if loginMan.login(retry=True):
  File "/tmp/pywikibot-core/pywikibot/login.py", line 298, in login
    self.check_user_exists()
  File "/tmp/pywikibot-core/pywikibot/login.py", line 160, in check_user_exists
    % (main_username, self.site))
pywikibot.exceptions.NoUsername: Username 'Whym test0' does not exist on wikibooks:ja
<class 'pywikibot.exceptions.NoUsername'>

Event Timeline

Change 399625 had a related patch set uploaded (by Whym; owner: Whym):
[pywikibot/core@master] Add option to auto-create accounts when logging in

https://gerrit.wikimedia.org/r/399625

Xqt claimed this task.
Xqt reassigned this task from Xqt to whym.
Xqt added a subscriber: Xqt.

Change 399625 merged by jenkins-bot:
[pywikibot/core@master] Add option to auto-create accounts when logging in

https://gerrit.wikimedia.org/r/399625