equal
deleted
inserted
replaced
69 """See base.View._editGet(). |
69 """See base.View._editGet(). |
70 """ |
70 """ |
71 |
71 |
72 # fill in the founded_by with data from the entity |
72 # fill in the founded_by with data from the entity |
73 form.fields['founded_by'].initial = entity.founder.name |
73 form.fields['founded_by'].initial = entity.founder.name |
|
74 super(View, self)._editGet(request, entity, form) |
74 |
75 |
75 def _editPost(self, request, entity, fields): |
76 def _editPost(self, request, entity, fields): |
76 """See base.View._editPost(). |
77 """See base.View._editPost(). |
77 """ |
78 """ |
78 |
79 |
79 if not entity: |
80 if not entity: |
80 # only if we are creating a new entity we should fill in founder |
81 # only if we are creating a new entity we should fill in founder |
81 account = users.get_current_user() |
82 account = users.get_current_user() |
82 user = user_logic.logic.getForFields({'account': account}, unique=True) |
83 user = user_logic.logic.getForFields({'account': account}, unique=True) |
83 fields['founder'] = user |
84 fields['founder'] = user |
|
85 |
|
86 super(View, self)._editPost(request, entity, fields) |