def make_star_false(sid): source = get_source(sid) if not source.star: source_star = SourceStar(source) db_session.add(source_star) db_session.commit() source.star.starred = False
def make_star_true(sid): source = get_source(sid) if source.star: source.star.starred = True else: source_star = SourceStar(source) db_session.add(source_star)