Skip to content

Commit 6a1a9ea

Browse files
committed
Merge pull request django-cms#2498 from pulilab/support/2.4.x
get_attribute should never raise KeyError
2 parents 965bcaf + 5a8944d commit 6a1a9ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

menus/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def get_absolute_url(self):
4949
return self.url
5050

5151
def get_attribute(self, name):
52-
return self.attr[name]
52+
return self.attr.get(name)
5353

5454
def get_descendants(self):
5555
nodes = []
@@ -63,4 +63,4 @@ def get_ancestors(self):
6363
if getattr(self, 'parent', None):
6464
nodes.append(self.parent)
6565
nodes += self.parent.get_ancestors()
66-
return nodes
66+
return nodes

0 commit comments

Comments
 (0)