Modify ↓
#11538 closed defect (fixed)
Unexpected keyword argument to TracError.__init__
Reported by: | Ryan J Ollos | Owned by: | osimons |
---|---|---|---|
Priority: | normal | Component: | CustomFieldAdminPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: |
Description
I've been reviewing the code for possible inclusion in the Trac core, and spotted the following issue:
-
customfieldadminplugin/0.11/customfieldadmin/api.py
diff --git a/customfieldadminplugin/0.11/customfieldadmin/api.py b/customfieldad index 7a263b5..03f2de9 100644
a b class CustomFields(Component): 106 106 # Check that it is a valid field type 107 107 if not cfield['type'] in \ 108 108 ['text', 'checkbox', 'select', 'radio', 'textarea']: 109 raise TracError(_("%(field_type)s is not a valid field type" ),110 field_type=cfield['type'])109 raise TracError(_("%(field_type)s is not a valid field type", 110 field_type=cfield['type'])) 111 111 # Check that field does not already exist 112 112 # (if modify it should already be deleted) 113 113 if create and self.config.get('ticket-custom', cfield['name']):
It's unlikely to cause any issues as far as I can see since there are other checks in place, but if the TracError
was raised, the following traceback would result:
Traceback (most recent call last): File "/home/user/Workspace/th11536/teo-rjollos.git/trac/web/main.py", line 506, in _dispatch_request dispatcher.dispatch(req) File "/home/user/Workspace/th11536/teo-rjollos.git/trac/web/main.py", line 221, in dispatch resp = chosen_handler.process_request(req) File "/home/user/Workspace/th11536/teo-rjollos.git/trac/admin/web_ui.py", line 125, in process_request path_info) File "/home/user/Workspace/trachacks.git/customfieldadminplugin/0.11/customfieldadmin/admin.py", line 87, in render_admin_panel cf_api.update_custom_field(cfield, create=True) File "/home/user/Workspace/trachacks.git/customfieldadminplugin/0.11/customfieldadmin/api.py", line 158, in update_custom_field self.verify_custom_field(cfield) File "/home/user/Workspace/trachacks.git/customfieldadminplugin/0.11/customfieldadmin/api.py", line 110, in verify_custom_field field_type=cfield['type']) TypeError: __init__() got an unexpected keyword argument 'field_type'
Attachments (0)
Change History (2)
comment:1 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 Changed 11 years ago by
Replying to rjollos:
I've been reviewing the code for possible inclusion in the Trac core, ...
I think this can be done in 20-30 hours effort, so I'm going to push it for milestone:1.1.3: trac:#11469.
Note: See
TracTickets for help on using
tickets.
In 13638: