@@ -13,7 +13,7 @@ import os, importlib, inspect, json | |||||
from .exceptions import * | from .exceptions import * | ||||
from .utils.jinja import get_jenv, get_template, render_template | from .utils.jinja import get_jenv, get_template, render_template | ||||
__version__ = "7.0.1" | |||||
__version__ = "7.0.2" | |||||
local = Local() | local = Local() | ||||
@@ -66,12 +66,10 @@ def get_desktop_icons(user=None): | |||||
for standard_icon in standard_icons: | for standard_icon in standard_icons: | ||||
if standard_icon.module_name not in user_icon_names: | if standard_icon.module_name not in user_icon_names: | ||||
# flag for modules_setup page | |||||
standard_icon.hidden_in_standard = standard_icon.hidden | |||||
# if blocked, hidden too! | # if blocked, hidden too! | ||||
if standard_icon.blocked: | if standard_icon.blocked: | ||||
standard_icon.hidden = 1 | standard_icon.hidden = 1 | ||||
standard_icon.hidden_in_standard = 1 | |||||
user_icons.append(standard_icon) | user_icons.append(standard_icon) | ||||
@@ -93,6 +93,8 @@ class EmailAccount(Document): | |||||
if self.enable_outgoing: | if self.enable_outgoing: | ||||
if not self.smtp_server: | if not self.smtp_server: | ||||
frappe.throw(_("{0} is required").format("SMTP Server")) | frappe.throw(_("{0} is required").format("SMTP Server")) | ||||
if not self.password: | |||||
frappe.throw(_("{0} is required").format("Password")) | |||||
server = SMTPServer(login = getattr(self, "login_id", None) \ | server = SMTPServer(login = getattr(self, "login_id", None) \ | ||||
or self.email_id, | or self.email_id, | ||||
@@ -105,6 +107,9 @@ class EmailAccount(Document): | |||||
def get_server(self, in_receive=False): | def get_server(self, in_receive=False): | ||||
"""Returns logged in POP3 connection object.""" | """Returns logged in POP3 connection object.""" | ||||
if not self.password: | |||||
frappe.throw(_("{0} is required").format("Password")) | |||||
args = { | args = { | ||||
"host": self.email_server, | "host": self.email_server, | ||||
"use_ssl": self.use_ssl, | "use_ssl": self.use_ssl, | ||||
@@ -568,8 +568,20 @@ def get_url(uri=None, full_address=False): | |||||
if hasattr(frappe.local, "request") and frappe.local.request and frappe.local.request.host: | if hasattr(frappe.local, "request") and frappe.local.request and frappe.local.request.host: | ||||
protocol = 'https' == frappe.get_request_header('X-Forwarded-Proto', "") and 'https://' or 'http://' | protocol = 'https' == frappe.get_request_header('X-Forwarded-Proto', "") and 'https://' or 'http://' | ||||
host_name = protocol + frappe.local.request.host | host_name = protocol + frappe.local.request.host | ||||
elif frappe.local.site: | elif frappe.local.site: | ||||
host_name = "http://{}".format(frappe.local.site) | |||||
protocol = 'http://' | |||||
if frappe.local.conf.ssl_certificate: | |||||
protocol = 'https://' | |||||
elif frappe.local.conf.wildcard: | |||||
domain = frappe.local.conf.wildcard.get('domain') | |||||
if domain and frappe.local.site.endswith(domain) and frappe.local.conf.wildcard.get('ssl_certificate'): | |||||
protocol = 'https://' | |||||
host_name = protocol + frappe.local.site | |||||
else: | else: | ||||
host_name = frappe.db.get_value("Website Settings", "Website Settings", | host_name = frappe.db.get_value("Website Settings", "Website Settings", | ||||
"subdomain") | "subdomain") | ||||