Fix problem with the name-based URL for showing AD documents

introduced with the import-whole-names change
 - Legacy-Id: 3701
This commit is contained in:
Ole Laursen 2011-11-24 15:46:46 +00:00
parent 610b56dfd0
commit 7f8df2edf1
2 changed files with 4 additions and 2 deletions

View file

@ -572,7 +572,7 @@ def by_ad(request, name):
role__group__type="area",
role__group__state="active")
| Q(pk__in=responsible)):
if name == p.name.lower().replace(" ", "."):
if name == p.full_name_as_key():
ad_id = p.id
ad_name = p.name
break

View file

@ -54,7 +54,9 @@ class PersonInfo(models.Model):
else:
return ""
def full_name_as_key(self):
return self.name.lower().replace(" ", ".")
# this is mostly a remnant from the old views, needed in the menu
prefix, first, middle, last, suffix = name_parts(self.name)
return (u"%s %s" % (first, last)).lower().replace(" ", ".")
class Meta:
abstract = True