From: Ɓukasz Rekucki Date: Wed, 2 Sep 2009 12:24:10 +0000 (+0200) Subject: Fixed DC panel form. PersonListField was raising a TypeError. X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/84921deab3e04b4e2501f92ba5f2923e4cc2d155 Fixed DC panel form. PersonListField was raising a TypeError. --- diff --git a/apps/explorer/forms.py b/apps/explorer/forms.py index d79bc74c..4946be69 100644 --- a/apps/explorer/forms.py +++ b/apps/explorer/forms.py @@ -19,7 +19,7 @@ class PersonListField(forms.Field): super(PersonListField, self).__init__(*args, **kwargs) def _get_initial(self): - return u'\n'.join( ( unicode(person) for person in self._initial) ) + return self._initial and (u'\n'.join( ( unicode(person) for person in self._initial))) def _set_initial(self, value): if value is None: diff --git a/apps/explorer/views.py b/apps/explorer/views.py index 6754930a..1f53771e 100644 --- a/apps/explorer/views.py +++ b/apps/explorer/views.py @@ -210,10 +210,9 @@ def dceditor_panel(request, path, repo): try: doc_text = repo.get_file(path, user_branch) - document = parser.WLDocument.from_string(doc_text) form = forms.DublinCoreForm(info=document.book_info) - + print "FORM: ", form return direct_to_template(request, 'explorer/panels/dceditor.html', extra_context={ 'fpath': path, 'form': form,