Type on mediaobject; set probably alive on person edit

svn: r19673
This commit is contained in:
Doug Blank 2012-05-27 14:03:17 +00:00
parent bbd443ba7d
commit baf98375f3
3 changed files with 3 additions and 2 deletions

View File

@ -622,7 +622,7 @@ class DbDjango(DbWriteBase, DbReadBase):
data = cPickle.loads(base64.decodestring(media.cache))
else:
data = self.dji.get_media(media)
return gen.lib.Media.create(data)
return gen.lib.MediaObject.create(data)
def get_place_from_handle(self, handle):
if handle in self.import_cache:

View File

@ -366,6 +366,7 @@ def process_person(request, context, handle, action, add_to=None): # view, edit,
# check if valid:
if nf.is_valid() and pf.is_valid() and sf.is_valid():
# name.preferred and surname.primary get set False in the above is_valid()
person.probably_alive = not bool(person.death)
update_last_changed(person, request.user.username)
person = pf.save()
# Process data:
@ -385,7 +386,6 @@ def process_person(request, context, handle, action, add_to=None): # view, edit,
surname.primary = True # FIXME: why is this False?
surname.save()
dji.rebuild_cache(person)
# FIXME: update probably_alive
if add_to:
item, handle = add_to
model = dji.get_model(item)

View File

@ -12,6 +12,7 @@ from webapp.dbdjango import DbDjango
from webapp.reports import import_file
from webapp.libdjango import DjangoInterface, totime, todate
from gen.datehandler import displayer, parser
import gen.lib
db = DbDjango()
dji = DjangoInterface()