]> git.openstreetmap.org Git - osqa.git/blob - forum/management/commands/render_bodies.py
Make RequestHolder thread-safe
[osqa.git] / forum / management / commands / render_bodies.py
1 # coding: utf-8
2
3 from django.core.management.base import BaseCommand
4 from forum.models import Node
5
6 import logging
7
8 class Command(BaseCommand):
9
10     def handle(self,*args, **options):
11         # Re-render node bodies
12         nodes = Node.objects.all()
13         for node in nodes:
14             try:
15                 node.body = node.rendered(node.body)
16                 node.save()
17                 print node.body
18             except Exception, e:
19                 logging.error(e)