X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/d6c4fb901ad64f828287556a26daab52449dab32..ee01d50d05b7d72dd372e8f3a0c78b9da6c23b38:/apps/wiki/forms.py?ds=sidebyside diff --git a/apps/wiki/forms.py b/apps/wiki/forms.py index d816cf0e..506ec8e0 100644 --- a/apps/wiki/forms.py +++ b/apps/wiki/forms.py @@ -1,5 +1,10 @@ +# -*- coding: utf-8 -*- +# +# This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django import forms -from wiki.models import Document, storage +from wiki.models import Document, getstorage class DocumentForm(forms.Form): @@ -15,12 +20,11 @@ class DocumentForm(forms.Form): self.fields['name'].initial = document.name self.fields['text'].initial = document.text self.fields['revision'].initial = document.revision() - - def get_storage(self): - return storage def save(self, document_author = 'anonymous'): - document = Document(self.get_storage(), name=self.cleaned_data['name'], text=self.cleaned_data['text']) + storage = getstorage() + + document = Document(storage, name=self.cleaned_data['name'], text=self.cleaned_data['text']) storage.put(document, author = document_author,