Re enable per source document type field
This commit is contained in:
@@ -183,8 +183,7 @@ class OutOfProcessSource(Source):
|
|||||||
|
|
||||||
class IntervalBaseModel(OutOfProcessSource):
|
class IntervalBaseModel(OutOfProcessSource):
|
||||||
interval = models.PositiveIntegerField(default=DEFAULT_INTERVAL, verbose_name=_('Interval'), help_text=_('Interval in seconds between checks for new documents.'))
|
interval = models.PositiveIntegerField(default=DEFAULT_INTERVAL, verbose_name=_('Interval'), help_text=_('Interval in seconds between checks for new documents.'))
|
||||||
# TEMP: Until migration problem is fixed
|
document_type = models.ForeignKey(DocumentType, verbose_name=_('Document type'), help_text=_('Assign a document type to documents uploaded from this source.'))
|
||||||
#document_type = models.ForeignKey(DocumentType, null=True, verbose_name=_('Document type'), help_text=_('Assign a document type to documents uploaded from this source.'))
|
|
||||||
uncompress = models.CharField(max_length=1, choices=SOURCE_UNCOMPRESS_CHOICES, verbose_name=_('Uncompress'), help_text=_('Whether to expand or not, compressed archives.'))
|
uncompress = models.CharField(max_length=1, choices=SOURCE_UNCOMPRESS_CHOICES, verbose_name=_('Uncompress'), help_text=_('Whether to expand or not, compressed archives.'))
|
||||||
|
|
||||||
def _get_periodic_task_name(self, pk=None):
|
def _get_periodic_task_name(self, pk=None):
|
||||||
@@ -369,9 +368,7 @@ class WatchFolderSource(IntervalBaseModel):
|
|||||||
if os.path.isfile(full_path):
|
if os.path.isfile(full_path):
|
||||||
|
|
||||||
with File(file=open(full_path, mode='rb')) as file_object:
|
with File(file=open(full_path, mode='rb')) as file_object:
|
||||||
# TEMP: Until migration document type problem is fixed
|
self.upload_document(file_object, label=file_name, document_type=self.document_type, expand=(self.uncompress == SOURCE_UNCOMPRESS_CHOICE_Y), language=LANGUAGE)
|
||||||
document_type = DocumentType.objects.all()[0]
|
|
||||||
self.upload_document(file_object, label=file_name, document_type=document_type, expand=(self.uncompress == SOURCE_UNCOMPRESS_CHOICE_Y), language=LANGUAGE)
|
|
||||||
os.unlink(full_path)
|
os.unlink(full_path)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|||||||
Reference in New Issue
Block a user