stages/user_write: always ignore `component` field and prevent warning

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-12-12 15:31:56 +00:00
parent 9ffc720f48
commit 5d51621278
1 changed files with 3 additions and 1 deletions

View File

@ -73,7 +73,9 @@ class UserWriteStageView(StageView):
"""Update `user` with data from plan context
Only simple attributes are updated, nothing which requires a foreign key or m2m"""
data = self.executor.plan.context[PLAN_CONTEXT_PROMPT]
data: dict = self.executor.plan.context[PLAN_CONTEXT_PROMPT]
# This is always sent back but not written to the user
data.pop("component", None)
for key, value in data.items():
setter_name = f"set_{key}"
# Check if user has a setter for this key, like set_password