Bugfix sorting exported reports for project and access permissions#266
Bugfix sorting exported reports for project and access permissions#266
Conversation
|
@rwrzesien I added now one more thing to this PR. Please look at it also because it is related with your PR with permissions. |
employees/views.py
Outdated
| check_permissions(allowed_user_types=[CustomUser.UserType.ADMIN.name, CustomUser.UserType.MANAGER.name]), | ||
| name="dispatch", | ||
| ) | ||
| class ExportReportsInProjectView(DetailView, UserIsManagerOfCurrentReportProjectMixin): |
There was a problem hiding this comment.
Just reverse classes here.
There was a problem hiding this comment.
@rwrzesien Exactly what I wanted you to see! When they are reversed they don't work :D And I am wondering why :P
There was a problem hiding this comment.
The problem was that instead of UserIsManagerOfCurrentReportProjectMixin it should use UserIsManagerOfCurrentProjectMixin, as this view looks up for Project, not Report.
Please remember to update AccessPermissionsTestCase if you modify anything regarding access permission, add new view etc. This is a remark to everyone involved in @Code-Poets/sheetstorm developing.
| self.assertEqual(self.report.description, self.workbook_for_user.active.cell(row=2, column=5).value) | ||
|
|
||
|
|
||
| class DataSetUpForSortingTests(TestCase): |
There was a problem hiding this comment.
I think that as long as this is used only in single subclass, there is no need to keep it in separate class.
|
@kbeker Thanks to this problem which you have found I have discovered some problems in access permission tests, for which fix, as discussed, I will add to this pull request, so it should resolve both problems. I have also resolved some other small problems with access permissions which I have found along the way. |
ec0c99f to
0a281c1
Compare
0a281c1 to
044b806
Compare
I tested one more time everything and I think all works :). Merging |
The point is that when manager exported project with all reports they were not sorted at all. This PR fixes it.