Opened 11 years ago
Closed 8 years ago
#11469 closed defect (fixed)
Exceptions in AccountModule._reset_password_enabled are not trapped in Trac 1.0.2dev
Reported by: | Ryan J Ollos | Owned by: | Steffen Hoffmann |
---|---|---|---|
Priority: | normal | Component: | AccountManagerPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: |
Description
While investigating #10980 using Trac 1.0.2dev, with the reporter's configuration I immediately saw a warning:
It looks like some changes are needed after [trac 12068].
-
accountmanagerplugin/trunk/acct_mgr/web_ui.py
diff --git a/accountmanagerplugin/trunk/acct_mgr/web_ui.py b/accountmanagerplugi index 0611206..3713dfe 100644
a b from genshi.builder import tag 19 19 20 20 from trac import perm, util 21 21 from trac.core import Component, implements 22 from trac.config import Configuration, BoolOption, IntOption, Option 22 from trac.config import Configuration, ConfigurationError, BoolOption, \ 23 IntOption, Option 23 24 from trac.env import open_environment 24 25 from trac.prefs import IPreferencePanelProvider 25 26 from trac.util import hex_entropy … … class AccountModule(CommonTemplateProvider): 106 107 def _reset_password_enabled(self, log=False): 107 108 try: 108 109 self.store.hash_method 109 except AttributeError:110 except (AttributeError, ConfigurationError): 110 111 return False 111 112 return is_enabled(self.env, self.__class__) and \ 112 113 self.reset_password and (self._write_check(log) != []) and \
Attachments (0)
Change History (5)
comment:1 follow-up: 2 Changed 10 years ago by
comment:2 Changed 10 years ago by
Replying to hasienda:
New error class
ConfigurationError
has been added during development for 1.0.2, andAccountModule
must handle it gracefully for that and all coming versions of Trac. }}}
That class was actually available back in Trac 0.11, possibly earlier: browser:/tags/trac-0.11/trac/config.py@:29-30#L15. The change on 1.0.2 was just to raise that exception class when ExtensionOption
has an Interface
that is not registered.
comment:3 Changed 10 years ago by
Ok, clearly I misunderstood Trac changeset 12068 then. Thanks for pointing this out.
comment:5 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
In 14274: