[Sync] document cleanup

This commit is contained in:
Roman Timashev committed 2017-09-19 19:51:56 +03:00
1 parent 8e587b5781
commit 12a9a41221
2 files changed
+2 -128

No files matched your search

+2 -8
View File
@@ -52,7 +52,7 @@ class Document(Model):
self.category = category
self.title = title
self.type = None
self.type = 'document' # 'award'
self.preview = None
super().__init__(provider, store, file)
@@ -93,7 +93,7 @@ class Document(Model):
'id': self.id,
'hash': self.hash,
'url': self.url,
'type': document_type(self.type),
'type': self.type,
'file': {
'name': filename,
'size': self.provider.size(file)
@@ -143,12 +143,6 @@ class Document(Model):
return '<Document hash={} file={} id={}>'.format(self.hash, self.file, self.id)
def document_type(doctype):
if doctype == 'Награды':
return 'award'
return 'document'
def pdf_to_jpg(provider, pdf):
_, temp_in = mkstemp(suffix='.pdf')
_, temp_out = mkstemp(suffix='.jpg')