Closed
Bug 793990
Opened 12 years ago
Closed 12 years ago
'NoneType' object has no attribute 'localized_string'
Categories
(Marketplace Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
2012-09-27
People
(Reporter: tarek, Assigned: tarek)
References
Details
Traceback (most recent call last):
File "/home/marketplace/zamboni/lib/misc/safe_signals.py", line 29, in safe_send
response = receiver(signal=self, sender=sender, **named)
File "/home/marketplace/zamboni/apps/reviews/models.py", line 91, in post_save
check_spam.apply_async(args=[instance.id], countdown=600)
File "/home/marketplace/.virtualenvs/marketplace/src/nuggets/celeryutils.py", line 22, in apply_async
return super(Task, self).apply_async(args, kwargs, **options)
File "/home/marketplace/zamboni/vendor/lib/python/celery/app/task/__init__.py", line 463, in apply_async
return self.apply(args, kwargs, task_id=task_id, **options)
File "/home/marketplace/zamboni/vendor/lib/python/celery/app/task/__init__.py", line 616, in apply
request=request, propagate=throw)
File "/home/marketplace/zamboni/vendor/lib/python/celery/execute/trace.py", line 220, in eager_trace_task
uuid, args, kwargs, request)
File "/home/marketplace/zamboni/vendor/lib/python/celery/execute/trace.py", line 153, in trace_task
R = retval = task(*args, **kwargs)
File "/home/marketplace/.virtualenvs/marketplace/src/nuggets/celeryutils.py", line 35, in wrapped
return fun(*args, **kw)
File "/home/marketplace/zamboni/apps/reviews/models.py", line 214, in check_spam
if bleach.url_re.search(review.body.localized_string):
AttributeError: 'NoneType' object has no attribute 'localized_string'
Assignee | ||
Comment 1•12 years ago
|
||
Proposed fix. Wil, r?
diff --git a/apps/reviews/models.py b/apps/reviews/models.py
index c48cb78..cec48dc 100644
--- a/apps/reviews/models.py
+++ b/apps/reviews/models.py
@@ -211,8 +211,10 @@ def check_spam(review_id, **kw):
.filter(user=review.user, created__gte=thirty_days))
if len(others) > 10:
spam.add(review, 'numbers')
- if bleach.url_re.search(review.body.localized_string):
+ if (review.body is not None and
+ bleach.url_re.search(review.body.localized_string)):
spam.add(review, 'urls')
+
for other in others:
if ((review.title and review.title == other.title)
or review.body == other.body):
Assignee | ||
Updated•12 years ago
|
Target Milestone: --- → 2012-09-27
Assignee | ||
Comment 2•12 years ago
|
||
made a pull req at https://github.com/mozilla/zamboni/pull/427
Assignee | ||
Comment 3•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•