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

chore(release): dev to main #2158

Merged
merged 3 commits into from
Jan 29, 2025
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion helpdesk/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.3.1"
__version__ = "1.4.0"
1 change: 0 additions & 1 deletion helpdesk/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
}
]

before_install = "helpdesk.setup.install.before_install"
after_install = "helpdesk.setup.install.after_install"
after_migrate = [
"helpdesk.search.build_index_in_background",
Expand Down
48 changes: 14 additions & 34 deletions helpdesk/setup/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
from .welcome_ticket import create_welcome_ticket


def before_install():
add_support_redirect_to_tickets()


def after_install():
add_default_categories_and_articles()
add_default_ticket_priorities()
Expand All @@ -33,38 +29,23 @@ def after_install():
add_property_setter()


def add_support_redirect_to_tickets():
website_settings = frappe.get_doc("Website Settings")

for route_redirects in website_settings.route_redirects:
if route_redirects.source == "support":
return

website_settings.append(
"route_redirects",
{
"source": "support",
"target": "support/tickets",
"redirect_http_status": 301,
},
)
website_settings.save()


def add_default_categories_and_articles():
category = frappe.get_doc(
{
"doctype": "HD Article Category",
"category_name": DEFAULT_ARTICLE_CATEGORY,
}
).insert()
category = frappe.db.exists("HD Article Category", DEFAULT_ARTICLE_CATEGORY)
if not category:
category = frappe.get_doc(
{
"doctype": "HD Article Category",
"category_name": DEFAULT_ARTICLE_CATEGORY,
}
).insert()
category = category.name
# TODO: create 4 articles sharing information about helpdesk
frappe.get_doc(
{
"doctype": "HD Article",
"title": "Introduction",
"content": "Content for your Article",
"category": category.name,
"category": category,
"published": False,
}
).insert()
Expand All @@ -73,7 +54,7 @@ def add_default_categories_and_articles():
def add_default_sla():

add_default_ticket_priorities()
add_default_holidy_list()
add_default_holiday_list()
enable_track_service_level_agreement_in_support_settings()

sla_doc = frappe.new_doc("HD Service Level Agreement")
Expand Down Expand Up @@ -167,7 +148,9 @@ def add_default_sla():
sla_doc.insert()


def add_default_holidy_list():
def add_default_holiday_list():
if frappe.db.exists("HD Service Holiday List", "Default"):
return
frappe.get_doc(
{
"doctype": "HD Service Holiday List",
Expand All @@ -179,14 +162,11 @@ def add_default_holidy_list():
}
).insert()

frappe.db.commit()


def enable_track_service_level_agreement_in_support_settings():
support_settings = frappe.get_doc("HD Settings")
support_settings.track_service_level_agreement = True
support_settings.save()
frappe.db.commit()


def add_default_ticket_priorities():
Expand Down
Loading