Don't provide a default for the scanner source adf_mode. Some scanners throw an error even when the selection if supported.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -173,7 +173,8 @@
|
||||
- Fix error when trying to upload a document from and email account with 'from' and 'subject' metadata.
|
||||
- Fix typo on message.header get from 'Suject' to 'Subject'.
|
||||
- On multi part emails keep the original From and Subject properties for all subsequent parts if the sub parts don't specify them. Fixes issue #481. Thanks to Robert Schöftner @robert.schoeftner for the report and debug information.
|
||||
|
||||
- Don't provide a default for the scanner source adf_mode. Some scanners throw an error even when the selection
|
||||
if supported.
|
||||
|
||||
|
||||
2.7.3 (2017-09-11)
|
||||
|
||||
@@ -519,6 +519,8 @@ Other changes worth mentioning
|
||||
- Fix error when trying to upload a document from and email account with 'from' and 'subject' metadata.
|
||||
- Fix typo on message.header get from 'Suject' to 'Subject'.
|
||||
- On multi part emails keep the original From and Subject properties for all subsequent parts if the sub parts don't specify them. Fixes issue #481. Thanks to Robert Schöftner @robert.schoeftner for the report and debug information.
|
||||
- Don't provide a default for the scanner source adf_mode. Some scanners throw an error even when the selection
|
||||
if supported.
|
||||
|
||||
Removals
|
||||
--------
|
||||
|
||||
20
mayan/apps/sources/migrations/0018_auto_20180608_0057.py
Normal file
20
mayan/apps/sources/migrations/0018_auto_20180608_0057.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.11 on 2018-06-08 00:57
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('sources', '0017_auto_20180510_2151'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='sanescanner',
|
||||
name='adf_mode',
|
||||
field=models.CharField(blank=True, choices=[('simplex', 'Simplex'), ('duplex', 'Duplex')], help_text='Selects the document feeder mode (simplex/duplex). If this option is not supported by your scanner, leave it blank.', max_length=16, verbose_name='ADF mode'),
|
||||
),
|
||||
]
|
||||
@@ -207,7 +207,7 @@ class SaneScanner(InteractiveSource):
|
||||
)
|
||||
adf_mode = models.CharField(
|
||||
blank=True, choices=SCANNER_ADF_MODE_CHOICES,
|
||||
default=SCANNER_ADF_MODE_SIMPLEX, help_text=_(
|
||||
help_text=_(
|
||||
'Selects the document feeder mode (simplex/duplex). If this '
|
||||
'option is not supported by your scanner, leave it blank.'
|
||||
), max_length=16, verbose_name=_('ADF mode')
|
||||
|
||||
@@ -161,73 +161,6 @@ class EmailFilenameDecodingTestCase(BaseTestCase):
|
||||
)
|
||||
|
||||
|
||||
@override_settings(OCR_AUTO_OCR=False)
|
||||
class IMAPSourceTestCase(BaseTestCase):
|
||||
class MockIMAP4_SSL(object):
|
||||
#def dele(self, which):
|
||||
# return
|
||||
|
||||
#def getwelcome(self):
|
||||
# return
|
||||
|
||||
#def list(self, which=None):
|
||||
# return (None, ['1 test'])
|
||||
|
||||
#def pass_(self, password):
|
||||
# return
|
||||
|
||||
#def quit(self):
|
||||
# return
|
||||
|
||||
#def retr(self, which=None):
|
||||
# return (
|
||||
# 1, [TEST_EMAIL_BASE64_FILENAME]
|
||||
# )
|
||||
|
||||
def fetch(self, message_set, message_parts):
|
||||
return 'STATUS', '(1 BODY[{}])'.format(TEST_EMAIL_ATTACHMENT_AND_INLINE)
|
||||
#status, data = mailbox.fetch(message_number, '(RFC822)')
|
||||
#EmailBaseModel.process_message(
|
||||
# source=self, message_text=data[0][1]
|
||||
#)
|
||||
#mailbox.store(message_number, '+FLAGS', '\\Deleted')
|
||||
|
||||
def login(self, username, password):
|
||||
return
|
||||
|
||||
def search(self, charset, *criterion):
|
||||
return (None, ['1'])
|
||||
|
||||
def select(self, mailbox):
|
||||
return
|
||||
|
||||
def user(self, username):
|
||||
return
|
||||
|
||||
def setUp(self):
|
||||
super(IMAPSourceTestCase, self).setUp()
|
||||
self.document_type = DocumentType.objects.create(
|
||||
label=TEST_DOCUMENT_TYPE_LABEL
|
||||
)
|
||||
|
||||
def tearDown(self):
|
||||
self.document_type.delete()
|
||||
super(IMAPSourceTestCase, self).tearDown()
|
||||
|
||||
@mock.patch('imaplib.IMAP4_SSL')
|
||||
def test_download_document(self, mock_imaplib):
|
||||
mock_imaplib.return_value = IMAPSourceTestCase.MockIMAP4_SSL()
|
||||
self.source = IMAPEmail.objects.create(
|
||||
document_type=self.document_type, label='', host='', password='',
|
||||
username=''
|
||||
)
|
||||
|
||||
self.source.check_source()
|
||||
self.assertEqual(
|
||||
Document.objects.first().label, 'Ampelm\xe4nnchen.txt'
|
||||
)
|
||||
|
||||
|
||||
@override_settings(OCR_AUTO_OCR=False)
|
||||
class POP3SourceTestCase(BaseTestCase):
|
||||
class MockMailbox(object):
|
||||
|
||||
Reference in New Issue
Block a user