Skip to content

Commit

Permalink
8.0 Use try/except when importing external libs (OCA#8)
Browse files Browse the repository at this point in the history
[FIX] LINT

Use try/except when importing external libs
Remove self.ensure_one() that has nothing to do in an api.model method
  • Loading branch information
Alexis de Lattre authored and V3st1g3 committed Nov 7, 2024
1 parent b473be7 commit 315bcec
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@
from openerp import models, api, _
from openerp.tools import float_compare
from openerp.exceptions import Warning as UserError
import PyPDF2
from lxml import etree
from StringIO import StringIO
import mimetypes
from urlparse import urlparse
import logging

logger = logging.getLogger(__name__)

try:
import PyPDF2
except ImportError:
logger.debug('Cannot import PyPDF2')


class BusinessDocumentImport(models.AbstractModel):
_name = 'business.document.import'
Expand Down

0 comments on commit 315bcec

Please sign in to comment.