Bugfix managers field in project admin form#472
Conversation
managers/forms.py
Outdated
| if hasattr(self, "user_pk"): | ||
| ManagerSelectMultiple.user_pk = self.user_pk | ||
|
|
||
| if "managers" in self.fields: |
There was a problem hiding this comment.
This check doesn't make much sense, as this field is in form by its definition. If you really want to check this, make it an assert.
There was a problem hiding this comment.
But manager is able to update project, too. However they don't have rights to update managers field in project and then we are using for themProjectManagerForm which inheritance from ProjectAdminForm but manager field is excluded in ProjectManagerForm
There was a problem hiding this comment.
Then inheritance doesn't make much sense here any more. It should be used if parent class can contain logic from subclasses so you don't have to repeat this logic. Here now those two forms have different logic. So please make ProjectManagerForm do not inherit from ProjectAdminForm and you can then remove this if.
Is this implemented?
I don't see this too. |
It is implemented in create view by someone else before that PR.
It is here, before we was excluding all the time |
Thanks, I thought you will be adding this in this PR and I didn't saw that code in PR that is why I have asked.
OK, what I have originally understood from |
rwrzesien
left a comment
There was a problem hiding this comment.
Looks good now, thanks for explanation, some small improvements can be applied.
@rwrzesien, Yes he can be removed, but before he was allways removed during first updating. |
0836337 to
ae03d59
Compare
ae03d59 to
3a10068
Compare
Resolves: #462
Should have done