Skip to content

Commit

Permalink
Merge branch 'master' of github.com:OpenTreeOfLife/phylografter into …
Browse files Browse the repository at this point in the history
…remove-legacy

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
  • Loading branch information
rhr committed Apr 5, 2014
2 parents 0aae2ae + 95c1e09 commit 6699ebf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
31 changes: 10 additions & 21 deletions controllers/snode.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,33 +48,22 @@ def update_snode():
if data:
if data.get('ingroup'):
db(db.snode.tree==rec.tree).update(ingroup=False)

userName=' '.join([auth.user.first_name, auth.user.last_name]
for k,v in data.items():
db.userEdit.insert(userName=userName,
tableName='snode',
rowId=rec.id,
fieldName=k,
previousValue=str(rec[k]),
updatedValue=str(v))

rec.update_record(**data)
session.flash = 'Node updated'
if 'ott_node' in data and rec.otu:
rec.otu.update_record(ott_node=data['ott_node'])
mytree = db.stree(rec.tree)
mytree.update_record(last_modified=datetime.datetime.now())

## for field in t.fields:
## if str(form.vars[attr]) != str(rec[attr]):
## if attr == 'ott_node':
## q = db.ott_node.id==form.vars[attr]
## updatedValue = db(q).select()[0].name
## if re.match("^[0-9]+$", str(rec[attr])):
## previousValue = db(db.ott_node.id==rec[attr]).select()[0].name
## else:
## previousValue = str(rec[attr])
## else:
## updatedValue = form.vars[attr]
## previousValue = str(rec[attr])

## userName=' '.join([auth.user.first_name, auth.user.last_name])
## db.userEdit.insert(userName=userName,
## tableName='snode',
## rowId=rec.id,
## fieldName=attr,
## previousValue=previousValue,
## updatedValue=updatedValue)

return dict(form=form)

Expand Down
4 changes: 3 additions & 1 deletion controllers/study.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ def view():
previousValue = str( rec[attr] ),
updatedValue = str( form.vars[attr] ) )

rec.update_record( last_modified = datetime.datetime.now() )
## not needed; mysql field is updated automatically
## rec.update_record( last_modified = datetime.datetime.now() )

response.flash = "record updated"

Expand Down Expand Up @@ -636,6 +637,7 @@ def tbimport2():
d = dict(citation = get('dcterms:bibliographicCitation'),
year_published = year if year else None,
label = get('tb:title.study'),
doi = get('prism:doi'),
treebase_id = treebase_id,
contributor = get('contributor'))

Expand Down

0 comments on commit 6699ebf

Please sign in to comment.