ソースを参照

Merge branch 'develop'

version-14
Rushabh Mehta 9年前
コミット
03d8333ce9
11個のファイルの変更49行の追加23行の削除
  1. +1
    -1
      frappe/__version__.py
  2. +5
    -7
      frappe/celery_app.py
  3. +1
    -2
      frappe/desk/page/messages/messages.py
  4. +11
    -1
      frappe/email/doctype/email_account/email_account.js
  5. +2
    -2
      frappe/email/doctype/email_account/email_account.py
  6. +1
    -1
      frappe/hooks.py
  7. +1
    -1
      frappe/public/js/frappe/form/toolbar.js
  8. +3
    -2
      frappe/public/js/frappe/ui/toolbar/notifications.js
  9. +18
    -0
      frappe/tasks.py
  10. +5
    -5
      frappe/utils/doctor.py
  11. +1
    -1
      setup.py

+ 1
- 1
frappe/__version__.py ファイルの表示

@@ -1,2 +1,2 @@
from __future__ import unicode_literals
__version__ = "6.15.2"
__version__ = "6.15.3"

+ 5
- 7
frappe/celery_app.py ファイルの表示

@@ -49,8 +49,7 @@ def get_celery_app():
app.conf.CELERY_SEND_EVENTS = True
app.conf.CELERY_SEND_TASK_SENT_EVENT = True

if conf.celery_queue_per_site:
app.conf.CELERY_ROUTES = (SiteRouter(), AsyncTaskRouter())
app.conf.CELERY_ROUTES = (SiteRouter(), AsyncTaskRouter())

app.conf.CELERYBEAT_SCHEDULE = get_beat_schedule(conf)

@@ -90,11 +89,10 @@ def get_beat_schedule(conf):
},
}

if conf.celery_queue_per_site:
schedule['sync_queues'] = {
'task': 'frappe.tasks.sync_queues',
'schedule': timedelta(seconds=conf.scheduler_interval or DEFAULT_SCHEDULER_INTERVAL)
}
schedule['sync_queues'] = {
'task': 'frappe.tasks.sync_queues',
'schedule': timedelta(seconds=conf.scheduler_interval or DEFAULT_SCHEDULER_INTERVAL)
}

return schedule



+ 1
- 2
frappe/desk/page/messages/messages.py ファイルの表示

@@ -31,9 +31,9 @@ def get_list(arg=None):
return frappe.db.sql("""select * from `tabComment`
where (owner=%(contact)s
or comment_docname=%(user)s
or (owner=comment_docname and ifnull(parenttype, "")!="Assignment")
or owner=comment_docname)
and comment_doctype ='Message'
and ifnull(parenttype, "")!="Assignment"
order by creation desc
limit %(limit_start)s, %(limit_page_length)s""", frappe.local.form_dict, as_dict=1)
else:
@@ -42,7 +42,6 @@ def get_list(arg=None):
or (owner=%(user)s and comment_docname=%(contact)s)
or (owner=%(contact)s and comment_docname=%(contact)s))
and comment_doctype ='Message'
and ifnull(parenttype, "")!="Assignment"
order by creation desc
limit %(limit_start)s, %(limit_page_length)s""", frappe.local.form_dict, as_dict=1)



+ 11
- 1
frappe/email/doctype/email_account/email_account.js ファイルの表示

@@ -59,6 +59,7 @@ frappe.ui.form.on("Email Account", {
frm.set_value(key, value);
});
}
frm.events.show_gmail_message_for_less_secure_apps(frm);
},
use_imap: function(frm) {
if (frm.doc.use_imap) {
@@ -92,5 +93,14 @@ frappe.ui.form.on("Email Account", {
refresh: function(frm) {
frm.events.enable_incoming(frm);
frm.events.notify_if_unreplied(frm);
}
frm.events.show_gmail_message_for_less_secure_apps(frm);
},
show_gmail_message_for_less_secure_apps: function(frm) {
frm.dashboard.reset();
if(frm.doc.service==="GMail") {
frm.dashboard.set_headline_alert('GMail will only work if you allows access for Less Secure \
Apps in GMail Settings. <a target="_blank" \
href="https://support.google.com/accounts/answer/6010255?hl=en">Read this for details</a>');
}
},
});

+ 2
- 2
frappe/email/doctype/email_account/email_account.py ファイルの表示

@@ -117,11 +117,11 @@ class EmailAccount(Document):
try:
email_server.connect()
except (error_proto, imaplib.IMAP4.error), e:
if in_receive and e.message=="-ERR authentication failed":
if in_receive and (e.message=="-ERR authentication failed" or "log in via your web browser" in e.message):
# if called via self.receive and it leads to authentication error, disable incoming
# and send email to system manager
self.handle_incoming_connect_error(
description=_('Authentication failed while receiving emails from Email Account {0}'.format(self.name))
description=_('Authentication failed while receiving emails from Email Account {0}. Message from server: {1}'.format(self.name, e.message))
)

return None


+ 1
- 1
frappe/hooks.py ファイルの表示

@@ -5,7 +5,7 @@ app_publisher = "Frappe Technologies Pvt. Ltd."
app_description = "Full stack web framework with Python, Javascript, MariaDB, Redis, Node"

app_icon = "octicon octicon-circuit-board"
app_version = "6.15.2"
app_version = "6.15.3"
app_color = "orange"
source_link = "https://github.com/frappe/frappe"
app_license = "MIT"


+ 1
- 1
frappe/public/js/frappe/form/toolbar.js ファイルの表示

@@ -125,7 +125,7 @@ frappe.ui.form.Toolbar = Class.extend({
}

// email
if(frappe.model.can_email(null, me.frm)) {
if(frappe.model.can_email(null, me.frm) && me.frm.doc.docstatus < 2) {
this.page.add_menu_item(__("Email"), function() {
me.frm.email_doc();}, true);
}


+ 3
- 2
frappe/public/js/frappe/ui/toolbar/notifications.js ファイルの表示

@@ -23,8 +23,9 @@ frappe.ui.notifications.update_notifications = function() {

// add to toolbar and sidebar
$.each(doctypes, function(i, doctype) {
if(!in_list(["ToDo", "Comment", "Event"]))
frappe.ui.notifications.add_notification(doctype);
if(!in_list(["ToDo", "Comment", "Event"], doctype)) {
frappe.ui.notifications.add_notification(doctype);
}
});

// set click events


+ 18
- 0
frappe/tasks.py ファイルの表示

@@ -57,10 +57,15 @@ def sync_worker(app, worker, prefix=''):
required_queues = set(get_required_queues(app, prefix=prefix))
to_add = required_queues - active_queues
to_remove = active_queues - required_queues

for queue in to_add:
if is_site_in_maintenance_mode(queue, prefix):
continue

app.control.broadcast('add_consumer', arguments={
'queue': queue
}, reply=True, destination=[worker])

for queue in to_remove:
app.control.broadcast('cancel_consumer', arguments={
'queue': queue
@@ -79,6 +84,19 @@ def get_required_queues(app, prefix=''):
ret.append(app.conf['CELERY_DEFAULT_QUEUE'])
return ret

def is_site_in_maintenance_mode(queue, prefix):
# check if site is in maintenance mode
site = queue.replace(prefix, "")
try:
frappe.init(site=site)
if not frappe.local.conf.db_name or frappe.local.conf.maintenance_mode:
# don't add site if in maintenance mode
return True
finally:
frappe.destroy()

return False

@celery_task()
def scheduler_task(site, event, handler, now=False):
traceback = ""


+ 5
- 5
frappe/utils/doctor.py ファイルの表示

@@ -16,11 +16,11 @@ def get_redis_conn():
def get_queues(site=None):
"Returns the name of queues where frappe enqueues tasks as per the configuration"
queues = ["celery"]
if frappe.conf.celery_queue_per_site:
sites = [site] if site else frappe.utils.get_sites()
for site in sites:
queues.append(site)
queues.append('longjobs@' + site)
sites = [site] if site else frappe.utils.get_sites()
for site in sites:
queues.append(site)
queues.append('longjobs@' + site)
return queues

def get_task_body(taskstr):


+ 1
- 1
setup.py ファイルの表示

@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
from pip.req import parse_requirements

version = "6.15.2"
version = "6.15.3"
requirements = parse_requirements("requirements.txt", session="")

setup(


読み込み中…
キャンセル
保存