From 540531c916814428a937280798a10806e0099250 Mon Sep 17 00:00:00 2001 From: zodman Date: Tue, 26 Sep 2017 17:06:34 -0500 Subject: [PATCH 1/3] fix css --- helpdesk/static/helpdesk/helpdesk-extend.css | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/helpdesk/static/helpdesk/helpdesk-extend.css b/helpdesk/static/helpdesk/helpdesk-extend.css index e2c0e59a..4d280241 100644 --- a/helpdesk/static/helpdesk/helpdesk-extend.css +++ b/helpdesk/static/helpdesk/helpdesk-extend.css @@ -50,7 +50,10 @@ Bootstrap overrides #searchtabs {margin-bottom: 20px;} .row_tablehead, table.table caption {background-color: #dbd5d9;} -table.table caption {height: 2em; line-height: 2em; font-weight: bold;} +table.table caption { + padding-left: 2em; + line-height: 2em; font-weight: bold; +} table.ticket-stats caption {color: #fbff00; font-style: italic;} table.ticket-stats tbody th, table.ticket-stats tbody tr {padding-left: 20px} From 03a57bdc5fe412747eb9ea251b649691483ee827 Mon Sep 17 00:00:00 2001 From: zodman Date: Wed, 27 Sep 2017 12:40:47 -0500 Subject: [PATCH 2/3] fix get_email from gmail imap --- demo/demodesk/config/settings.py | 5 +++++ helpdesk/management/commands/get_email.py | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/demo/demodesk/config/settings.py b/demo/demodesk/config/settings.py index 24b9eccc..070f91cb 100644 --- a/demo/demodesk/config/settings.py +++ b/demo/demodesk/config/settings.py @@ -207,3 +207,8 @@ MEDIA_ROOT = os.path.join(BASE_DIR, 'media') # - This is only necessary to make the demo project work, not needed for # your own projects unless you make your own fixtures FIXTURE_DIRS = [os.path.join(BASE_DIR, 'fixtures')] + +try: + from .local_settings import * +except ImportError: + pass diff --git a/helpdesk/management/commands/get_email.py b/helpdesk/management/commands/get_email.py index 476c7d89..5b2c2036 100755 --- a/helpdesk/management/commands/get_email.py +++ b/helpdesk/management/commands/get_email.py @@ -340,13 +340,14 @@ def ticket_from_message(message, queue, logger): if not name: ext = mimetypes.guess_extension(part.get_content_type()) name = "part-%i%s" % (counter, ext) - payload = part.get_payload() + if isinstance(payload, list): + payload = payload.pop().as_string() payloadToWrite = payload try: logger.debug("Try to base64 decode the attachment payload") payloadToWrite = base64.decodestring(payload) - except binascii.Error: + except binascii.Error, TypeError: logger.debug("Payload was not base64 encoded, using raw bytes") payloadToWrite = payload files.append(SimpleUploadedFile(name, part.get_payload(decode=True), mimetypes.guess_type(name)[0])) From f06cbce07c4ed161e6b75c501f066295fd5c391a Mon Sep 17 00:00:00 2001 From: zodman Date: Wed, 27 Sep 2017 12:50:51 -0500 Subject: [PATCH 3/3] fix the python3 --- helpdesk/management/commands/get_email.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpdesk/management/commands/get_email.py b/helpdesk/management/commands/get_email.py index 5b2c2036..40c25b1f 100755 --- a/helpdesk/management/commands/get_email.py +++ b/helpdesk/management/commands/get_email.py @@ -347,7 +347,7 @@ def ticket_from_message(message, queue, logger): try: logger.debug("Try to base64 decode the attachment payload") payloadToWrite = base64.decodestring(payload) - except binascii.Error, TypeError: + except (binascii.Error, TypeError): logger.debug("Payload was not base64 encoded, using raw bytes") payloadToWrite = payload files.append(SimpleUploadedFile(name, part.get_payload(decode=True), mimetypes.guess_type(name)[0]))