Code

Opened 8 years ago

Closed 8 years ago

#2218 closed defect (duplicate)

AttributeError in syndication/feeds.py

Reported by: jvinet@… Owned by: jacob
Component: Documentation Version: master
Severity: normal Keywords: feed
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I've set up a basic feed for news updates, but when trying to access it, I get an AttributeError: 'NoneType' object has no attribute 'startswith'.

This fixes it for me:

--- feeds.py.old 2006-06-22 20:41:57.000000000 -0700
+++ feeds.py 2006-06-22 20:42:01.000000000 -0700
@@ -5,7 +5,7 @@

from django.conf import settings

def add_domain(domain, url):

+ if url and not url.startswith('http://'):

url = u'http://%s%s' % (domain, url)

return url

Not sure if I've set something up wrong or not, but with this patch, the feed works as expected.

I'm running off the latest SVN revision.

Attachments (0)

Change History (2)

comment:1 Changed 8 years ago by mtredinnick

  • Component changed from RSS framework to Documentation
  • Owner changed from adrian to jacob

This is a documentation bug, not a code bug. I believe that all of the places where we call add_domain require a real URL, it is not optional in the feed specs (need to check all the specs to make sure, though). So we shouldn't let people avoid having URLs in these places.

A better error message wouldn't kill us in those cases, too -- explaining where the URL was forgotten.

comment:2 Changed 8 years ago by ubernostrum

  • Resolution set to duplicate
  • Status changed from new to closed

This is a duplicate of #1961, which I'm going to reopen.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.