Skip to content

Commit

Permalink
[#262] Fix helper import in controller feed
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Jan 9, 2013
1 parent c86c61a commit e8a2afb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ckan/controllers/feed.py
Expand Up @@ -28,7 +28,7 @@

from ckan import model
from ckan.lib.base import BaseController, c, request, response, json, abort, g
from ckan.lib.helpers import date_str_to_datetime, url_for
import ckan.lib.helpers as h
from ckan.logic import get_action, NotFound

# TODO make the item list configurable
Expand Down Expand Up @@ -345,18 +345,18 @@ def output_feed(self, results, feed_title, feed_description,
for pkg in results:
feed.add_item(
title=pkg.get('title', ''),
link=self.base_url + url_for(controller='package',
link=self.base_url + h.url_for(controller='package',
action='read',
id=pkg['id']),
description=pkg.get('notes', ''),
updated=date_str_to_datetime(pkg.get('metadata_modified')),
published=date_str_to_datetime(pkg.get('metadata_created')),
updated=h.date_str_to_datetime(pkg.get('metadata_modified')),
published=h.date_str_to_datetime(pkg.get('metadata_created')),
unique_id=_create_atom_id(u'/dataset/%s' % pkg['id']),
author_name=pkg.get('author', ''),
author_email=pkg.get('author_email', ''),
categories=[t['name'] for t in pkg.get('tags', [])],
enclosure=webhelpers.feedgenerator.Enclosure(
self.base_url + url_for(controller='api',
self.base_url + h.url_for(controller='api',
register='package',
action='show',
id=pkg['name'],
Expand All @@ -374,7 +374,7 @@ def _feed_url(self, query, controller, action, **kwargs):
Constructs the url for the given action. Encoding the query
parameters.
"""
path = url_for(controller=controller, action=action, **kwargs)
path = h.url_for(controller=controller, action=action, **kwargs)
query = [(k, v.encode('utf-8') if isinstance(v, basestring)
else str(v)) for k, v in query.items()]

Expand Down

0 comments on commit e8a2afb

Please sign in to comment.