Skip to content

Commit

Permalink
* Remove unneeded form.
Browse files Browse the repository at this point in the history
* Add platform upload code the real document forms.
  • Loading branch information
bgroff committed Jun 18, 2018
1 parent a5266db commit 36da813
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 60 deletions.
60 changes: 0 additions & 60 deletions django_kala/documents/forms.py

This file was deleted.

6 changes: 6 additions & 0 deletions django_kala/projects/forms/documents/new_document.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django import forms
from django.conf import settings

from documents.models import Document, DocumentVersion

Expand Down Expand Up @@ -35,4 +36,9 @@ class Meta:
def save(self, document, commit=True):
self.instance.document = document
self.instance.user = self.user
manager = settings.PLATFORM_MANAGER()
manager.upload_document(self.cleaned_data['file'].read(), str(self.instance.uuid))
# TODO: Remove this when file uploading becomes more civilized.
self.file = None

return super(NewDocumentVersionForm, self).save(commit)
6 changes: 6 additions & 0 deletions django_kala/projects/forms/documents/new_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django import forms
from django.conf import settings

from documents.models import Document, DocumentVersion

Expand All @@ -17,4 +18,9 @@ class Meta:
def save(self, commit=True):
self.instance.document = self.document
self.instance.user = self.user
manager = settings.PLATFORM_MANAGER()
manager.upload_document(self.cleaned_data['file'].read(), str(self.instance.uuid))
# TODO: Remove this when file uploading becomes more civilized.
self.file = None

return super(NewDocumentVersionForm, self).save(commit)

0 comments on commit 36da813

Please sign in to comment.