Modify ↓
Opened 9 years ago
Closed 9 years ago
#12107 closed defect (fixed)
TypeError: object of type 'NoneType' has no len()
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.7 |
Component: | ticket system | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Fixed traceback when navigating to |
||
API Changes: | |||
Internal Changes: |
Description
Navigating directly to /newticket?preview=1
results in the following error:
2015-06-15 22:05:07,962 Trac[main] ERROR: Internal Server Error: Traceback (most recent call last): File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.6post2-py2.6.egg/trac/web/main.py", line 534, in _dispatch_request dispatcher.dispatch(req) File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.6post2-py2.6.egg/trac/web/main.py", line 227, in dispatch resp = chosen_handler.process_request(req) File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.6post2-py2.6.egg/trac/ticket/web_ui.py", line 183, in process_request return self._process_newticket_request(req) File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.6post2-py2.6.egg/trac/ticket/web_ui.py", line 466, in _process_newticket_request valid = self._validate_ticket(req, ticket) File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.6post2-py2.6.egg/trac/ticket/web_ui.py", line 1282, in _validate_ticket if len(ticket['summary']) > self.max_summary_size: TypeError: object of type 'NoneType' has no len()
This is not of much concern, it's just an error I found in the logs. The fix appears to be simple though:
-
trac/ticket/web_ui.py
diff --git a/trac/ticket/web_ui.py b/trac/ticket/web_ui.py index 15680d6..ada9023 100644
a b class TicketModule(Component): 1279 1279 valid = False 1280 1280 1281 1281 # Validate summary length 1282 if len(ticket['summary'] ) > self.max_summary_size:1282 if len(ticket['summary'] or '') > self.max_summary_size: 1283 1283 add_warning(req, _("Ticket summary is too long (must be less " 1284 1284 "than %(num)s characters)", 1285 1285 num=self.max_summary_size))
Attachments (0)
Change History (1)
comment:1 by , 9 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Committed to 1.0-stable in [14112], merged to trunk in [14113].