Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
仰若水
frappe
Commits
1effc2f5
Commit
1effc2f5
authored
9 years ago
by
Nabin Hait
Browse files
Options
Download
Plain Diff
Merge branch 'develop'
parents
51f81bc3
04579cce
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
frappe/__version__.py
+1
-1
frappe/__version__.py
frappe/auth.py
+8
-8
frappe/auth.py
frappe/commands.py
+1
-0
frappe/commands.py
frappe/core/doctype/doctype/doctype.py
+1
-0
frappe/core/doctype/doctype/doctype.py
frappe/core/doctype/page/page.py
+4
-0
frappe/core/doctype/page/page.py
frappe/email/doctype/email_account/email_account.py
+2
-9
frappe/email/doctype/email_account/email_account.py
frappe/hooks.py
+1
-1
frappe/hooks.py
frappe/model/db_query.py
+1
-1
frappe/model/db_query.py
frappe/model/db_schema.py
+8
-2
frappe/model/db_schema.py
frappe/public/js/frappe/views/communication.js
+1
-1
frappe/public/js/frappe/views/communication.js
frappe/templates/pages/print.py
+4
-1
frappe/templates/pages/print.py
frappe/translations/zh-cn.csv
+9
-0
frappe/translations/zh-cn.csv
frappe/utils/pdf.py
+8
-1
frappe/utils/pdf.py
frappe/website/render.py
+1
-1
frappe/website/render.py
setup.py
+1
-1
setup.py
with
51 additions
and
27 deletions
+51
-27
frappe/__version__.py
View file @
1effc2f5
from
__future__
import
unicode_literals
__version__
=
"5.0.
29
"
__version__
=
"5.0.
30
"
This diff is collapsed.
Click to expand it.
frappe/auth.py
View file @
1effc2f5
...
...
@@ -57,14 +57,6 @@ class HTTPRequest:
# run login triggers
if
frappe
.
form_dict
.
get
(
'cmd'
)
==
'login'
:
frappe
.
local
.
login_manager
.
run_trigger
(
'on_session_creation'
)
self
.
clear_active_sessions
()
def
clear_active_sessions
(
self
):
if
not
frappe
.
conf
.
get
(
"deny_multiple_sessions"
):
return
if
frappe
.
session
.
user
!=
"Guest"
:
clear_sessions
(
frappe
.
session
.
user
,
keep_current
=
True
)
def
set_lang
(
self
,
lang_codes
):
...
...
@@ -134,6 +126,14 @@ class LoginManager:
# reset user if changed to Guest
self
.
user
=
frappe
.
local
.
session_obj
.
user
frappe
.
local
.
session
=
frappe
.
local
.
session_obj
.
data
self
.
clear_active_sessions
()
def
clear_active_sessions
(
self
):
if
not
frappe
.
conf
.
get
(
"deny_multiple_sessions"
):
return
if
frappe
.
session
.
user
!=
"Guest"
:
clear_sessions
(
frappe
.
session
.
user
,
keep_current
=
True
)
def
authenticate
(
self
,
user
=
None
,
pwd
=
None
):
if
not
(
user
and
pwd
):
...
...
This diff is collapsed.
Click to expand it.
frappe/commands.py
View file @
1effc2f5
...
...
@@ -613,6 +613,7 @@ def console(context):
site
=
get_single_site
(
context
)
frappe
.
init
(
site
=
site
)
frappe
.
connect
()
frappe
.
local
.
lang
=
frappe
.
db
.
get_default
(
"lang"
)
import
IPython
IPython
.
embed
()
...
...
This diff is collapsed.
Click to expand it.
frappe/core/doctype/doctype/doctype.py
View file @
1effc2f5
...
...
@@ -315,6 +315,7 @@ def validate_fields(meta):
if
not
d
.
permlevel
:
d
.
permlevel
=
0
if
not
d
.
fieldname
:
frappe
.
throw
(
_
(
"Fieldname is required in row {0}"
).
format
(
d
.
idx
))
d
.
fieldname
=
d
.
fieldname
.
lower
()
check_illegal_characters
(
d
.
fieldname
)
check_unique_fieldname
(
d
.
fieldname
)
check_illegal_mandatory
(
d
)
...
...
This diff is collapsed.
Click to expand it.
frappe/core/doctype/page/page.py
View file @
1effc2f5
...
...
@@ -26,6 +26,10 @@ class Page(Document):
cnt
=
1
self
.
name
+=
'-'
+
str
(
cnt
)
def
validate
(
self
):
if
not
getattr
(
conf
,
'developer_mode'
,
0
):
frappe
.
throw
(
_
(
"Not in Developer Mode"
))
# export
def
on_update
(
self
):
"""
...
...
This diff is collapsed.
Click to expand it.
frappe/email/doctype/email_account/email_account.py
View file @
1effc2f5
...
...
@@ -190,15 +190,8 @@ class EmailAccount(Document):
parent
=
frappe
.
get_doc
(
"Communication"
,
in_reply_to
)
if
parent
.
reference_name
:
if
self
.
append_to
:
# parent must reference only if name matches
if
parent
.
reference_doctype
==
self
.
append_to
:
# parent same as parent of last communication
parent
=
frappe
.
get_doc
(
parent
.
reference_doctype
,
parent
.
reference_name
)
else
:
parent
=
frappe
.
get_doc
(
parent
.
reference_doctype
,
parent
.
reference_name
)
parent
=
frappe
.
get_doc
(
parent
.
reference_doctype
,
parent
.
reference_name
)
if
not
parent
and
self
.
append_to
and
sender_field
:
if
subject_field
:
...
...
This diff is collapsed.
Click to expand it.
frappe/hooks.py
View file @
1effc2f5
...
...
@@ -4,7 +4,7 @@ app_title = "Frappe Framework"
app_publisher
=
"Frappe Technologies Pvt. Ltd."
app_description
=
"Full Stack Web Application Framework in Python"
app_icon
=
"octicon octicon-circuit-board"
app_version
=
"5.0.
29
"
app_version
=
"5.0.
30
"
app_color
=
"orange"
app_email
=
"support@frappe.io"
...
...
This diff is collapsed.
Click to expand it.
frappe/model/db_query.py
View file @
1effc2f5
...
...
@@ -297,7 +297,7 @@ class DatabaseQuery(object):
# share is an OR condition, if there is a role permission
if
not
only_if_shared
and
self
.
shared
:
self
.
or
_conditions
.
append
(
self
.
get_share_condition
())
self
.
match
_conditions
.
append
(
" or {0}"
.
format
(
self
.
get_share_condition
())
)
if
as_condition
:
conditions
=
""
...
...
This diff is collapsed.
Click to expand it.
frappe/model/db_schema.py
View file @
1effc2f5
...
...
@@ -234,7 +234,14 @@ class DbTable:
query
.
append
(
'alter column `{}` set default {}'
.
format
(
col
.
fieldname
,
col_default
))
if
query
:
frappe
.
db
.
sql
(
"alter table `{}` {}"
.
format
(
self
.
name
,
", "
.
join
(
query
)))
try
:
frappe
.
db
.
sql
(
"alter table `{}` {}"
.
format
(
self
.
name
,
", "
.
join
(
query
)))
except
Exception
,
e
:
# sanitize
if
e
.
args
[
0
]
==
1060
:
frappe
.
throw
(
str
(
e
))
else
:
raise
e
class
DbColumn
:
def
__init__
(
self
,
table
,
fieldname
,
fieldtype
,
length
,
default
,
...
...
@@ -469,4 +476,3 @@ def add_column(doctype, column_name, fieldtype, precision=None):
frappe
.
db
.
commit
()
frappe
.
db
.
sql
(
"alter table `tab%s` add column %s %s"
%
(
doctype
,
column_name
,
get_definition
(
fieldtype
,
precision
)))
This diff is collapsed.
Click to expand it.
frappe/public/js/frappe/views/communication.js
View file @
1effc2f5
...
...
@@ -331,7 +331,7 @@ frappe.views.CommunicationComposer = Class.extend({
btn
:
btn
,
callback
:
function
(
r
)
{
if
(
!
r
.
exc
)
{
if
(
form_values
.
send_email
)
if
(
form_values
.
send_email
&&
r
.
message
[
"
recipients
"
]
)
msgprint
(
__
(
"
Email sent to {0}
"
,
[
r
.
message
[
"
recipients
"
]]));
me
.
dialog
.
hide
();
...
...
This diff is collapsed.
Click to expand it.
frappe/templates/pages/print.py
View file @
1effc2f5
...
...
@@ -277,7 +277,10 @@ def get_visible_columns(data, table_meta, df):
# columns specified by column builder
for
col_df
in
df
.
get
(
"visible_columns"
):
# load default docfield properties
newdf
=
table_meta
.
get_field
(
col_df
.
get
(
"fieldname"
)).
as_dict
().
copy
()
docfield
=
table_meta
.
get_field
(
col_df
.
get
(
"fieldname"
))
if
not
docfield
:
continue
newdf
=
docfield
.
as_dict
().
copy
()
newdf
.
update
(
col_df
)
if
add_column
(
newdf
):
columns
.
append
(
newdf
)
...
...
This diff is collapsed.
Click to expand it.
frappe/translations/zh-cn.csv
View file @
1effc2f5
...
...
@@ -1468,3 +1468,12 @@ DocType: System Settings,mm-dd-yyyy,月-日-年
apps/frappe/frappe/desk/doctype/feed/feed.py +91,{0} logged in,{0}已登录
apps/frappe/frappe/templates/emails/new_user.html +4,Your login id is,您的登录ID是
DocType: DocField,Ignore User Permissions,忽略用户权限
apps/frappe/frappe/templates/pages/login.html +29,Email address,登入电子邮件
apps/frappe/frappe/templates/pages/login.html +40,Password,密码
apps/frappe/frappe/templates/pages/login.html +36,Sign in,登入
apps/frappe/frappe/templates/pages/login.html +40,Not a user yet? Sign up,不是用户吗?注册吧
apps/frappe/frappe/templates/pages/login.html +44,Forgot Password?,忘记密码了?
apps/frappe/frappe/templates/pages/login.html +54,Sign up,注册
apps/frappe/frappe/templates/pages/login.html +56,Have an account? Login,已经有账号了?登入吧
apps/frappe/frappe/templates/pages/login.html +67,Send Password,发密码到邮箱
apps/frappe/frappe/templates/pages/login.html +69,Back to Login,返回登入
This diff is collapsed.
Click to expand it.
frappe/utils/pdf.py
View file @
1effc2f5
...
...
@@ -4,6 +4,7 @@ from __future__ import unicode_literals
import
pdfkit
,
os
,
frappe
from
frappe.utils
import
scrub_urls
from
frappe
import
_
def
get_pdf
(
html
,
options
=
None
):
if
not
options
:
...
...
@@ -27,7 +28,13 @@ def get_pdf(html, options=None):
html
=
scrub_urls
(
html
)
fname
=
os
.
path
.
join
(
"/tmp"
,
frappe
.
generate_hash
()
+
".pdf"
)
pdfkit
.
from_string
(
html
,
fname
,
options
=
options
or
{})
try
:
pdfkit
.
from_string
(
html
,
fname
,
options
=
options
or
{})
except
IOError
,
e
:
if
"ContentNotFoundError"
in
e
.
message
:
frappe
.
throw
(
_
(
"PDF generation failed because of broken image links"
))
else
:
raise
with
open
(
fname
,
"rb"
)
as
fileobj
:
filedata
=
fileobj
.
read
()
...
...
This diff is collapsed.
Click to expand it.
frappe/website/render.py
View file @
1effc2f5
...
...
@@ -18,6 +18,7 @@ class PageNotFoundError(Exception): pass
def
render
(
path
,
http_status_code
=
None
):
"""render html page"""
path
=
resolve_path
(
path
.
strip
(
"/ "
))
frappe
.
local
.
lang
=
frappe
.
db
.
get_default
(
"lang"
)
try
:
data
=
render_page
(
path
)
...
...
@@ -216,4 +217,3 @@ def clear_cache(path=None):
for
method
in
frappe
.
get_hooks
(
"website_clear_cache"
):
frappe
.
get_attr
(
method
)(
path
)
This diff is collapsed.
Click to expand it.
setup.py
View file @
1effc2f5
from
setuptools
import
setup
,
find_packages
version
=
"5.0.
29
"
version
=
"5.0.
30
"
with
open
(
"requirements.txt"
,
"r"
)
as
f
:
install_requires
=
f
.
readlines
()
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help