Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[minor] supress duplicate icon error in setup wizard #2327

Merged
merged 1 commit into from
Nov 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion frappe/commands/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def new_site(site, mariadb_root_username=None, mariadb_root_password=None, admin
"Create a new site"
frappe.init(site=site, new_site=True)

_new_site(None, site, mariadb_root_username=mariadb_root_username, mariadb_root_password=mariadb_root_password, admin_password=admin_password,
_new_site(db_name, site, mariadb_root_username=mariadb_root_username, mariadb_root_password=mariadb_root_password, admin_password=admin_password,
verbose=verbose, install_apps=install_app, source_sql=source_sql, force=force)

if len(frappe.utils.get_sites()) == 1:
Expand Down
8 changes: 0 additions & 8 deletions frappe/core/doctype/communication/comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@
from frappe.model.db_schema import add_column
from frappe.exceptions import ImplicitCommitError

def validate_comment(doc):
"""Raise exception for more than 50 comments."""
if not (doc.communication_type=='Comment' and doc.reference_doctype and doc.reference_name):
return

if doc.comment_type=="Comment" and "<!-- markdown -->" not in doc.content:
doc.content += '\n<!-- markdown -->'

def on_trash(doc):
if doc.communication_type != "Comment":
return
Expand Down
5 changes: 2 additions & 3 deletions frappe/core/doctype/communication/communication.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from frappe import _
from frappe.model.document import Document
from frappe.utils import validate_email_add, get_fullname, strip_html, cstr
from frappe.core.doctype.communication.comment import (validate_comment,
notify_mentions, update_comment_in_doc)
from frappe.core.doctype.communication.comment import (notify_mentions,
update_comment_in_doc)
from frappe.core.doctype.communication.email import (validate_email,
notify, _notify, update_parent_status)
from frappe.utils.bot import BotReply
Expand Down Expand Up @@ -43,7 +43,6 @@ def validate(self):
self.set_status()
self.set_sender_full_name()
validate_email(self)
validate_comment(self)
self.set_timeline_doc()

def after_insert(self):
Expand Down
8 changes: 6 additions & 2 deletions frappe/desk/doctype/desktop_icon/desktop_icon.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def set_order(new_order, user=None):

clear_desktop_icons_cache()

def set_desktop_icons(visible_list):
def set_desktop_icons(visible_list, ignore_duplicate=True):
'''Resets all lists and makes only the given one standard,
if the desktop icon does not exist and the name is a DocType, then will create
an icon for the doctype'''
Expand All @@ -188,7 +188,11 @@ def set_desktop_icons(visible_list):
frappe.db.set_value('Desktop Icon', name, 'hidden', 0)
else:
if frappe.db.exists('DocType', module_name):
add_user_icon(module_name, standard=1)
try:
add_user_icon(module_name, standard=1)
except frappe.UniqueValidationError, e:
if not ignore_duplicate:
raise e

# set the order
set_order(visible_list)
Expand Down
2 changes: 1 addition & 1 deletion frappe/public/js/frappe/views/reports/query_report.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ frappe.views.QueryReport = Class.extend({
}
},
pdf_report: function() {
base_url = frappe.urllib.get_base_url();
base_url = frappe.urllib.get_base_url();
print_css = frappe.boot.print_css;

if(!frappe.model.can_print(this.report_doc.ref_doctype)) {
Expand Down