db.flush after creating Activation to generate code

currently reset_password emails look like this:

Hello, user!

Someone requested resetting your password. If it was you, click here:
http://localhost/reset_password/None

db.flush() should be called in order to generate the activation.code before throwing it in an email.