Revision: 8451 Author: xqt Date: 2010-08-24 12:11:22 +0000 (Tue, 24 Aug 2010)
Log Message: ----------- Do not ask for restictions twice for the internal function.
Modified Paths: -------------- trunk/pywikipedia/userlib.py
Modified: trunk/pywikipedia/userlib.py =================================================================== --- trunk/pywikipedia/userlib.py 2010-08-24 11:58:29 UTC (rev 8450) +++ trunk/pywikipedia/userlib.py 2010-08-24 12:11:22 UTC (rev 8451) @@ -378,7 +378,6 @@ raise AutoblockUser if self.isBlocked() and not reBlock: raise AlreadyBlocked() - if not self.site().isAllowed('block', sysop=True): raise UserActionRefuse('You don't have permission to block') if not expiry: @@ -439,20 +438,11 @@ def _blockOld(self, expiry, reason, anonOnly, noSignup, enableAutoblock, emailBan, watchUser, allowUsertalk): """ - Block the user by web page. + Internal use to block the user by web page. + Don't use this function directly.
"""
- if self.name()[0] == '#': - #This user is probably being queried for purpose of lifting - #an autoblock, so can't be blocked. - raise AutoblockUser - if not self.site().isAllowed('block', sysop=True): - raise UserActionRefuse('You don't have permission to block') - if expiry is None: - expiry = input(u'Please enter the expiry time for the block:') - if reason is None: - reason = input(u'Please enter a reason for the block:') token = self.site().getToken(self, sysop = True) pywikibot.output(u"Blocking [[User:%s]]..." % self.name()) boolStr = ['0','1']