Skip to content

Commit

Permalink
[#1521][s]: Remove what looks like erroneous repetitive code.
Browse files Browse the repository at this point in the history
  • Loading branch information
teajaymars committed Jan 20, 2012
1 parent 8518d09 commit b7db6b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 2 additions & 7 deletions ckan/controllers/group.py
Expand Up @@ -83,21 +83,16 @@ def read(self, id):
except NotAuthorized:
abort(401, _('Unauthorized to read group %s') % id)
try:
description_formatted = ckan.misc.MarkdownFormat().to_html(c.group.get('description',''))
description_formatted = ckan.misc.MarkdownFormat().to_html(c.group_dict.get('description',''))
c.description_formatted = genshi.HTML(description_formatted)
except Exception, e:
error_msg = "<span class='inline-warning'>%s</span>" % _("Cannot render description")
c.description_formatted = genshi.HTML(error_msg)

try:
desc_formatted = ckan.misc.MarkdownFormat().to_html(c.group.description)
desc_formatted = genshi.HTML(desc_formatted)
except genshi.ParseError, e:
desc_formatted = 'Error: Could not parse group description'
c.group_description_formatted = desc_formatted
c.group_admins = self.authorizer.get_admins(c.group)

context['return_query'] = True

results = get_action('group_package_show')(context, data_dict)

c.page = Page(
Expand Down
4 changes: 2 additions & 2 deletions ckan/templates/group/read.html
Expand Up @@ -24,8 +24,8 @@ <h3>Administrators</h3>

<py:match path="content">
<h3 py:if="c.group['state'] != 'active'">State: ${c.group['state']}</h3>
<div class="notes" py:if="str(c.group_description_formatted).strip()">
${c.group_description_formatted}
<div class="notes" py:if="str(c.description_formatted).strip()">
${c.description_formatted}
</div>
<div class="group-dataset-list">
<h3>Datasets</h3>
Expand Down

0 comments on commit b7db6b4

Please sign in to comment.