Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
addressbook
Commits
8204d5c4a3b7
Commit
e15b7562
authored
Mar 23, 2011
by
Sylvain Thénault
Browse files
entity.keys() has gone in 3.10, use cw_edited instead (closes #1560564)
--HG-- branch : stable
parent
41e1cdba1dd2
Changes
1
Hide whitespace changes
Inline
Side-by-side
hooks.py
View file @
8204d5c4
"""addressbook hooks
:organization: Logilab
:copyright: 2001-20
09
LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.
:copyright: 2001-20
11
LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
"""
...
...
@@ -23,7 +23,7 @@ class AutoSetLatLng(Hook):
if
not
gmapkey
:
return
geoattrs
=
set
((
'street'
,
'street2'
,
'postalcode'
,
'city'
,
'country'
))
changed_attrs
=
set
(
self
.
entity
.
keys
()
)
changed_attrs
=
set
(
self
.
entity
.
cw_edited
)
if
(
geoattrs
&
changed_attrs
and
not
self
.
entity
.
get
(
'latitude'
)
and
not
self
.
entity
.
get
(
'longitude'
)):
...
...
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