# HG changeset patch # User Brian Neal # Date 1431820272 18000 # Node ID 5366c29d6dcefdce5781e59420cced7a12771297 # Parent c614edb5b51e2e90489ea5bd91920ece4adaeaac Django's SortedDict is gone. Use OrderedDict instead. For Django 1.7.8 upgrade. diff -r c614edb5b51e -r 5366c29d6dce forums/forms.py --- a/forums/forms.py Sat May 16 15:06:52 2015 -0500 +++ b/forums/forms.py Sat May 16 18:51:12 2015 -0500 @@ -2,6 +2,8 @@ Forms for the forums application. """ +from collections import OrderedDict + from django import forms from django.conf import settings @@ -161,10 +163,16 @@ topic_name = kwargs.pop('topic_name', None) super(PostForm, self).__init__(*args, **kwargs) - if topic_name is not None: # this is a "first post" - self.fields.insert(0, 'name', forms.CharField(label='Subject', - max_length=255, - widget=forms.TextInput(attrs={'size': 64}))) + if topic_name is not None: + # this is a "first post", add a field for a topic name + new_fields = OrderedDict(name=forms.CharField( + label='Subject', max_length=255, + widget=forms.TextInput(attrs={ + 'class': 'title', + 'style': 'width: 90%', + }))) + new_fields.update(self.fields) + self.fields = new_fields self.initial['name'] = topic_name attachments = args[0].getlist('attachment') if len(args) else []