reddit/reddit — pull request #896 by buddydvd (2013-09-10 08:40:28+00:00)
Title: admintools: add missing stub for `bans_for_domain_parts`

**Note to the admins** -- to reproduce the error that this patch fixes, you need to run reddit without the non-opensourced `r2admin.models.admintools` module imported through [here](https://github.com/reddit/reddit/blob/master/r2/r2/models/admintools.py#L437-L440). This bug only manifests itself when executed without that module.

So, because `r2.models.admintools` doesn't define `bans_for_domain_parts`, submitting a link causes the app to throw this exception:

sys.path: ['/usr/local/bin', '/home/reddit/reddit/r2', '/usr/lib/python2.7/dist-packages/PIL', '/usr/lib/pymodules/python2.7', '/home/reddit/reddit-i18n', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages']
Module r2.lib.validator.validator:236 in newfn view
>> simple_vals, param_vals, *a, **kw)
Module r2.lib.validator.validator:306 in validatedForm view
>> *a, **kw)
Module r2.lib.validator.validator:285 in _validatedForm view
>> val = self_method(self, form, responder, *a, **kw)
Module r2.controllers.api:379 in POST_submit view
>> filled_quota = c.user.quota_full('link')
Module r2.models.account:583 in quota_full view
>> limits = self.quota_limits(kind)
Module r2.models.account:577 in quota_limits view
>> if self.cromulent():
Module r2.models.account:567 in cromulent view
>> if self.has_banned_email():
Module r2.models.account:554 in has_banned_email view
>> which = self.which_emails_are_banned((canon,))
Module r2.models.account:543 in which_emails_are_banned view
>> from r2.models.admintools import bans_for_domain_parts
ImportError: cannot import name bans_for_domain_parts

This pull request adds the missing stub for `bans_for_domain_parts` to fix this issue.