Skip to content

Commit 40a44a7

Browse files
author
Richard Jones
committed
Made "creator" property a String like it should be (we can't lookup()
retired users reliably)
1 parent 45fbad5 commit 40a44a7

File tree

3 files changed

+8
-30
lines changed

3 files changed

+8
-30
lines changed

roundup/backends/back_anydbm.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
#$Id: back_anydbm.py,v 1.73 2002-09-10 00:11:49 richard Exp $
18+
#$Id: back_anydbm.py,v 1.74 2002-09-10 08:04:56 richard Exp $
1919
'''
2020
This module defines a backend that saves the hyperdatabase in a database
2121
chosen by anydbm. It is guaranteed to always be available in python
@@ -976,14 +976,9 @@ def get(self, nodeid, propname, default=_marker, cache=1):
976976
raise ValueError, 'Journalling is disabled for this class'
977977
journal = self.db.getjournal(self.classname, nodeid)
978978
if journal:
979-
name = self.db.getjournal(self.classname, nodeid)[0][2]
979+
return self.db.getjournal(self.classname, nodeid)[0][2]
980980
else:
981-
return None
982-
try:
983-
return self.db.user.lookup(name)
984-
except KeyError:
985-
# the journaltag user doesn't exist any more
986-
return None
981+
return self.db.journaltag
987982

988983
# get the property (raises KeyErorr if invalid)
989984
prop = self.properties[propname]
@@ -1734,7 +1729,9 @@ def getprops(self, protected=1):
17341729
d['id'] = String()
17351730
d['creation'] = hyperdb.Date()
17361731
d['activity'] = hyperdb.Date()
1737-
d['creator'] = hyperdb.Link("user")
1732+
# can't be a link to user because the user might have been
1733+
# retired since the journal entry was created
1734+
d['creator'] = hyperdb.String()
17381735
return d
17391736

17401737
def addprop(self, **properties):

roundup/cgi/templating.py

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,6 @@ def __getitem__(self, item):
227227
# we don't exist
228228
if item == 'id':
229229
return None
230-
if item == 'creator':
231-
# but we will be created by this user...
232-
return HTMLUser(self._client, 'user', self._client.userid)
233230

234231
# get the property
235232
prop = self._props[item]
@@ -768,7 +765,7 @@ def __getattr__(self, attr):
768765

769766
def plain(self, escape=0):
770767
if self._value is None:
771-
return _('[unselected]')
768+
return ''
772769
linkcl = self._db.classes[self._prop.classname]
773770
k = linkcl.labelprop(1)
774771
value = str(linkcl.get(self._value, k))
@@ -807,21 +804,6 @@ def field(self):
807804
l.append('</select>')
808805
return '\n'.join(l)
809806

810-
def download(self, showid=0):
811-
linkname = self._prop.classname
812-
linkcl = self._db.getclass(linkname)
813-
k = linkcl.labelprop(1)
814-
linkvalue = cgi.escape(str(linkcl.get(self._value, k)))
815-
if showid:
816-
label = value
817-
title = ' title="%s"'%linkvalue
818-
# note ... this should be urllib.quote(linkcl.get(value, k))
819-
else:
820-
label = linkvalue
821-
title = ''
822-
return '<a href="%s%s/%s"%s>%s</a>'%(linkname, self._value,
823-
linkvalue, title, label)
824-
825807
def menu(self, size=None, height=None, showid=0, additional=[],
826808
**conditions):
827809
value = self._value
@@ -864,7 +846,6 @@ def menu(self, size=None, height=None, showid=0, additional=[],
864846
l.append('<option %svalue="%s">%s</option>'%(s, optionid, lab))
865847
l.append('</select>')
866848
return '\n'.join(l)
867-
868849
# def checklist(self, ...)
869850

870851
class MultilinkHTMLProperty(HTMLProperty):

roundup/templates/classic/html/issue.item

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
</table>
6363

6464
<span tal:condition="context/id" tal:content="structure string:Created on
65-
<b>${context/creation}</b> by <b>${context/creator/username}</b>, last
65+
<b>${context/creation}</b> by <b>${context/creator}</b>, last
6666
changed <b>${context/activity}</b>.">activity info</span>
6767

6868
<tal:block tal:condition="context/id">

0 commit comments

Comments
 (0)