Change item default owner to self

This commit is contained in:
Madis Mägi 2024-08-24 18:01:52 +03:00
parent bd89df82be
commit 6bf80cf820

View File

@ -81,8 +81,9 @@ def setup_user_select(select_field, name_fields):
name_field.data = value name_field.data = value
def setup_default_owner(select_field): def setup_default_owner(select_field):
user = read_user()
c = select_field.choices c = select_field.choices
d = [i for i in c if i[1] == "K-SPACE MTÜ"] d = [i for i in c if i[0] == (user and user.get("username") or "k-space")]
if len(d) < 1: if len(d) < 1:
return return
dv = d[0] or None dv = d[0] or None