X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/8e91963c85103b7b47eb6e6d39656bc938c55e0e..121349bc707dc31a4e1dd46392960ba02aada1d1:/forum_modules/exporter/exporter.py diff --git a/forum_modules/exporter/exporter.py b/forum_modules/exporter/exporter.py index 49f89da..8907112 100644 --- a/forum_modules/exporter/exporter.py +++ b/forum_modules/exporter/exporter.py @@ -93,8 +93,13 @@ def ET_Element_add_tag(el, tag_name, content = None, **attrs): if content: try: tag.text = unicode(content) - except: - tag.text = u'' + except Exception, e: + #logging.error('error converting unicode characters') + #import traceback + #logging.error(traceback.print_exc()) + + import string + tag.text = unicode("".join([c for c in content if c in string.printable])) for k, v in attrs.items(): tag.set(k, unicode(v)) @@ -410,7 +415,7 @@ def export_nodes(n, el, anon_data): el.add('author', n.author.id) el.add('date', make_date(n.added_at)) el.add('parent', n.parent and n.parent.id or "") - el.add('absparent', n.abs_parent and n.abs_parent or "") + el.add('absparent', n.abs_parent and n.abs_parent.id or "") act = el.add('lastactivity') act.add('by', n.last_activity_by and n.last_activity_by.id or "") @@ -446,6 +451,7 @@ def export_nodes(n, el, anon_data): rev.add('tags', ", ".join(r.tagname_list())) el.add('marked', n.marked and 'true' or 'false') + el.add('wiki', n.nis.wiki and 'true' or 'false') el.add('extraRef', n.extra_ref and n.extra_ref.id or "") make_extra(el.add('extraData'), n.extra) el.add('extraCount', n.extra_count and n.extra_count or "")