[docs] Incorrect example in `viktor.api_v1.API`

The example code in viktor.api_v1.API doesn’t work. In entity.parent() the entity isn’t defined and should be current_entity.

current_entity = API().get_entity(entity_id)
parent = entity.parent()  # << ❌ Incorrect
parent = current_entity.parent()  # << ✅ Correct
parent_params = parent.last_saved_params

Thanks for notifying, will be updated as soon as possible!

EDIT: docs have been updated.

1 Like