Conversation
| self.project.save() | ||
| self.project.managers.add(self.user) | ||
| self.project.members.add(self.user) | ||
| self.url = reverse('custom-project-delete', args=(self.project.pk,)) |
There was a problem hiding this comment.
I think that it would be better to keep this url as a string
There was a problem hiding this comment.
Done
5ae6623 to
ee26823
Compare
a032878 to
55c35f3
Compare
07607ba to
4de302e
Compare
55c35f3 to
7049ae8
Compare
4de302e to
0a0cfbc
Compare
|
|
||
|
|
||
| def delete_project(request, pk): | ||
| if request.user.user_type == CustomUser.UserType.ADMIN.name: |
There was a problem hiding this comment.
@Karrp @MartynaAnnaGottschling Question about how this should exactly work - here implementation shows that only ADMIN should be allowed to perform this action. In template, everyone can click on this (which is a little bit miselading, I think it should be shown only for admins), however the real issue is that admins doesn't have access Projects List from the menu.
There was a problem hiding this comment.
Hey, might be late to respond but unless you already applied some fixes, I can navigate to project list from menu, while signed in as admin.
And since all delete operations (except for individual reports) should be performed only by admin, you are right that the delete button should be visible only to admin.
There was a problem hiding this comment.
But the delete button is in update template, which is accessable from detail template, only for admin, I think...
There was a problem hiding this comment.
@MartynaAnnaGottschling @maciejSamerdak I think I was able to reach it as manager too. Anyway, the point is that if it should be doable only by admin, only admin should be able to click on it - it might be bad user experience if there will be a button visible for users that when clicked will redirect them to home without telling them what actually happened. So we should agree on who can do and see what - for me both ways make sense (admin and manager who created this project or just admin), but whatever we choose lets be consistent.
We will probably solve more of the permissions cases in the future so lets just focus on this one now.
There was a problem hiding this comment.
@Karrp says only admin should be able to delete a project.
7049ae8 to
0ea2d58
Compare
0a65109 to
edfb40c
Compare
0ea2d58 to
9366ba5
Compare
9366ba5 to
a0cdd95
Compare
Resolves #50
Resolves #51