Lock user account for a period

def lock_account(self, minutes=30):
        """ Lock user account for a period """
        period = datetime.timedelta(minutes=minutes)
        self.locked_until = datetime.datetime.utcnow() + period