def set_superuser(self): with self.app.app_context(): AccountDomain.update_raw(self.account['_id'], {'$set': {'role': 'superuser'}})