fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
assigning tickets, new ui
[redakcja.git]
/
apps
/
wiki
/
forms.py
diff --git
a/apps/wiki/forms.py
b/apps/wiki/forms.py
index
55b1e54
..
3626b6d
100644
(file)
--- a/
apps/wiki/forms.py
+++ b/
apps/wiki/forms.py
@@
-40,7
+40,8
@@
class DocumentCreateForm(forms.ModelForm):
class Meta:
model = Book
class Meta:
model = Book
- exclude = ['gallery']
+ exclude = ['gallery', 'parent', 'parent_number']
+ prepopulated_fields = {'slug': ['title']}
def clean(self):
super(DocumentCreateForm, self).clean()
def clean(self):
super(DocumentCreateForm, self).clean()
@@
-164,7
+165,7
@@
class ChunkForm(forms.ModelForm):
chunk = Chunk.objects.get(book=self.instance.book, slug=slug)
except Chunk.DoesNotExist:
return slug
chunk = Chunk.objects.get(book=self.instance.book, slug=slug)
except Chunk.DoesNotExist:
return slug
- if chunk == self:
+ if chunk == self
.instance
:
return slug
raise forms.ValidationError(_('Chunk with this slug already exists'))
return slug
raise forms.ValidationError(_('Chunk with this slug already exists'))