<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def register_success(self, upgrade):
 """Register a successful upgrade."""

        u = Upgrade(upgrade=upgrade.name, applied=datetime.now())
        db.session.add(u)
        db.session.commit()