Skip to content

Commit 8034e83

Browse files
committed
Merge branch 'hotfix'
2 parents 5668e77 + d4a062f commit 8034e83

File tree

7 files changed

+28
-11
lines changed

7 files changed

+28
-11
lines changed

frappe/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from .exceptions import *
1515
from .utils.jinja import get_jenv, get_template, render_template, get_email_from_template
1616

17-
__version__ = '10.1.53'
17+
__version__ = '10.1.54'
1818
__title__ = "Frappe Framework"
1919

2020
local = Local()

frappe/contacts/report/addresses_and_contacts/addresses_and_contacts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def get_party_details(party_type, party_list, doctype, party_details):
9191

9292
records = frappe.get_list(doctype, filters=filters, fields=fields, as_list=True)
9393
for d in records:
94-
details = party_details.get(d[0])
94+
details = party_details.get(d[0]) or {}
9595
details.setdefault(frappe.scrub(doctype), []).append(d[1:])
9696

9797
return party_details

frappe/desk/page/setup_wizard/setup_wizard.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,12 @@ def setup_complete(args):
5454
and clears cache. If wizard breaks, calls `setup_wizard_exception` hook"""
5555

5656
# Setup complete: do not throw an exception, let the user continue to desk
57-
if cint(frappe.db.get_single_value('System Settings', 'setup_complete')):
57+
if (frappe.cache().hget("setup_wizard", "in_setup") or
58+
cint(frappe.db.get_single_value('System Settings', 'setup_complete'))):
5859
return
5960

61+
frappe.cache().hset("setup_wizard", "in_setup", True)
62+
6063
args = parse_args(args)
6164

6265
stages = get_setup_stages(args)
@@ -70,17 +73,19 @@ def setup_complete(args):
7073
for task in stage.get('tasks'):
7174
current_task = task
7275
task.get('fn')(task.get('args'))
73-
7476
except Exception:
7577
handle_setup_exception(args)
7678
return {'status': 'fail', 'fail': current_task.get('fail_msg')}
7779
else:
7880
run_setup_success(args)
7981
return {'status': 'ok'}
82+
finally:
83+
frappe.cache().hdel("setup_wizard", "in_setup")
8084

8185
def update_global_settings(args):
82-
if args.language and args.language != "english":
86+
if args.language and args.language != "English":
8387
set_default_language(get_language_code(args.lang))
88+
frappe.db.commit()
8489
frappe.clear_cache()
8590

8691
update_system_settings(args)
@@ -236,6 +241,7 @@ def load_messages(language):
236241
javascript files"""
237242
frappe.clear_cache()
238243
set_default_language(get_language_code(language))
244+
frappe.db.commit()
239245
m = get_dict("page", "setup-wizard")
240246

241247
for path in frappe.get_hooks("setup_wizard_requires"):

frappe/hooks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,15 @@
154154
"frappe.email.doctype.auto_email_report.auto_email_report.send_daily",
155155
"frappe.core.doctype.feedback_request.feedback_request.delete_feedback_request",
156156
"frappe.core.doctype.activity_log.activity_log.clear_authentication_logs",
157-
"frappe.utils.change_log.check_for_update"
158157
],
159158
"daily_long": [
160159
"frappe.integrations.doctype.dropbox_settings.dropbox_settings.take_backups_daily",
161160
"frappe.integrations.doctype.s3_backup_settings.s3_backup_settings.take_backups_daily"
162161
],
163162
"weekly_long": [
164163
"frappe.integrations.doctype.dropbox_settings.dropbox_settings.take_backups_weekly",
165-
"frappe.integrations.doctype.s3_backup_settings.s3_backup_settings.take_backups_weekly"
164+
"frappe.integrations.doctype.s3_backup_settings.s3_backup_settings.take_backups_weekly",
165+
"frappe.utils.change_log.check_for_update"
166166
],
167167
"monthly": [
168168
"frappe.email.doctype.auto_email_report.auto_email_report.send_monthly"

frappe/translate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ def get_lang_code(lang):
7272

7373
def set_default_language(lang):
7474
"""Set Global default language"""
75-
frappe.db.set_default("lang", lang)
75+
if frappe.db.get_default("lang") != lang:
76+
frappe.db.set_default("lang", lang)
7677
frappe.local.lang = lang
7778

7879
def get_all_languages():

frappe/utils/change_log.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from frappe.utils import cstr
1010
import requests
1111
from frappe import _
12+
import git
1213

1314
def get_change_log(user=None):
1415
if not user: user = frappe.session.user
@@ -101,7 +102,12 @@ def get_versions():
101102
}
102103

103104
if versions[app]['branch'] != 'master':
104-
branch_version = app_hooks.get('{0}_version'.format(versions[app]['branch']))
105+
try:
106+
app_repo = git.Repo(os.path.join('..', 'apps', '{}'.format(app)))
107+
branch_version = '-'.join(app_repo.git.describe().split('-')[:2])
108+
branch_version = [branch_version.strip('v')]
109+
except:
110+
branch_version = app_hooks.get('{0}_version'.format(versions[app]['branch']))
105111
if branch_version:
106112
versions[app]['branch_version'] = branch_version[0] + ' ({0})'.format(get_app_last_commit_ref(app))
107113

@@ -137,7 +143,7 @@ def check_for_update():
137143

138144
github_version, org_name = app_details
139145
# Get local instance's current version or the app
140-
instance_version = Version(apps[app]['version'])
146+
instance_version = Version(apps[app]['branch_version'].split(' ')[0])
141147
# Compare and popup update message
142148
for update_type in updates:
143149
if github_version.__dict__[update_type] > instance_version.__dict__[update_type]:
@@ -149,6 +155,7 @@ def check_for_update():
149155
title = apps[app]['title'],
150156
))
151157
break
158+
if github_version.__dict__[update_type] < instance_version.__dict__[update_type]: break
152159

153160
add_message_to_redis(updates)
154161

@@ -196,6 +203,7 @@ def show_update_popup():
196203
return
197204

198205
updates = json.loads(update_info)
206+
current_versions = get_versions()
199207

200208
# Check if user is int the set of users to send update message to
201209
update_message = ""

requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ email_reply_parser
2727
click
2828
num2words==0.5.5
2929
watchdog==0.8.0
30-
bleach
30+
bleach==2.1.4
3131
bleach-whitelist
3232
Pillow
3333
beautifulsoup4
@@ -49,3 +49,5 @@ pypng
4949
premailer
5050
croniter
5151
googlemaps
52+
urllib3==1.23
53+
GitPython==2.1.11

0 commit comments

Comments
 (0)