mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2025-01-15 02:19:18 +01:00
Merge pull request #887 from alligatorbait/master
Update supported Django versions in documentation and correct 2 referenced before set bugs
This commit is contained in:
commit
39c09d2785
@ -10,7 +10,7 @@ Prerequisites
|
|||||||
Before getting started, ensure your system meets the following recommended dependencies:
|
Before getting started, ensure your system meets the following recommended dependencies:
|
||||||
|
|
||||||
* Python 3.6+
|
* Python 3.6+
|
||||||
* Django 2.x
|
* Django 2.2+, 3.x
|
||||||
|
|
||||||
Ensure any extra Django modules you wish to use are compatible before continuing.
|
Ensure any extra Django modules you wish to use are compatible before continuing.
|
||||||
|
|
||||||
|
@ -154,8 +154,6 @@ def imap_sync(q, logger, server):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
status, data = server.search(None, 'NOT', 'DELETED')
|
status, data = server.search(None, 'NOT', 'DELETED')
|
||||||
except imaplib.IMAP4.error:
|
|
||||||
logger.error("IMAP retrieve failed. Is the folder '%s' spelled correctly, and does it exist on the server?" % q.email_box_imap_folder)
|
|
||||||
if data:
|
if data:
|
||||||
msgnums = data[0].split()
|
msgnums = data[0].split()
|
||||||
logger.info("Received %d messages from IMAP server" % len(msgnums))
|
logger.info("Received %d messages from IMAP server" % len(msgnums))
|
||||||
@ -172,6 +170,8 @@ def imap_sync(q, logger, server):
|
|||||||
logger.info("Successfully processed message %s, deleted from IMAP server" % num)
|
logger.info("Successfully processed message %s, deleted from IMAP server" % num)
|
||||||
else:
|
else:
|
||||||
logger.warn("Message %s was not successfully processed, and will be left on IMAP server" % num)
|
logger.warn("Message %s was not successfully processed, and will be left on IMAP server" % num)
|
||||||
|
except imaplib.IMAP4.error:
|
||||||
|
logger.error("IMAP retrieve failed. Is the folder '%s' spelled correctly, and does it exist on the server?" % q.email_box_imap_folder)
|
||||||
|
|
||||||
server.expunge()
|
server.expunge()
|
||||||
server.close()
|
server.close()
|
||||||
|
@ -99,7 +99,6 @@ def text_is_spam(text, request):
|
|||||||
|
|
||||||
if hasattr(settings, 'TYPEPAD_ANTISPAM_API_KEY'):
|
if hasattr(settings, 'TYPEPAD_ANTISPAM_API_KEY'):
|
||||||
apikey = settings.TYPEPAD_ANTISPAM_API_KEY
|
apikey = settings.TYPEPAD_ANTISPAM_API_KEY
|
||||||
ak.baseurl = 'api.antispam.typepad.com/1.1/'
|
|
||||||
elif hasattr(settings, 'PYTHON_AKISMET_API_KEY'):
|
elif hasattr(settings, 'PYTHON_AKISMET_API_KEY'):
|
||||||
# new env var expected by python-akismet package
|
# new env var expected by python-akismet package
|
||||||
apikey = settings.PYTHON_AKISMET_API_KEY
|
apikey = settings.PYTHON_AKISMET_API_KEY
|
||||||
@ -114,6 +113,9 @@ def text_is_spam(text, request):
|
|||||||
key=apikey,
|
key=apikey,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if hasattr(settings, 'TYPEPAD_ANTISPAM_API_KEY'):
|
||||||
|
ak.baseurl = 'api.antispam.typepad.com/1.1/'
|
||||||
|
|
||||||
if ak.verify_key():
|
if ak.verify_key():
|
||||||
ak_data = {
|
ak_data = {
|
||||||
'user_ip': request.META.get('REMOTE_ADDR', '127.0.0.1'),
|
'user_ip': request.META.get('REMOTE_ADDR', '127.0.0.1'),
|
||||||
|
Loading…
Reference in New Issue
Block a user