You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
452 B
20 lines
452 B
# coding=utf-8
|
|
import os
|
|
import django
|
|
import sys
|
|
|
|
from lms.tools import convert_html_to_bb
|
|
|
|
sys.path.append("/var/www/projects/codemy/")
|
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lms.settings")
|
|
django.setup()
|
|
from management.models import Comment
|
|
|
|
errors = []
|
|
for comment in Comment.objects.all():
|
|
try:
|
|
comment.bbtext = convert_html_to_bb(comment.text)
|
|
except:
|
|
errors.append(comment.id)
|
|
else:
|
|
comment.save()
|
|
|