def populate_current_fields(abbr):
meta = db.metadata.find_one({'<STR_LIT>': abbr})<EOL>current_term = meta['<STR_LIT>'][-<NUM_LIT:1>]<EOL>current_session = current_term['<STR_LIT>'][-<NUM_LIT:1>]<EOL>for bill in db.bills.find({settings.LEVEL_FIELD: abbr}):<EOL><INDENT>if bill['<STR_LIT>'] == current_session:<EOL><INDENT>bill['<STR_LIT>'] = True<EOL><DEDENT>else:<EOL><INDENT>bill['<STR_LIT>'] = False<EOL><DEDENT>if bill['<STR_LIT>'] in current_term['<STR_LIT>']:<EOL><INDENT>bill['<STR_LIT>'] = True<EOL><DEDENT>else:<EOL><INDENT>bill['<STR_LIT>'] = False<EOL><DEDENT>db.bills.save(bill, safe=True)<EOL><DEDENT>
Set/update _current_term and _current_session fields on all bills
for a given location.