Skip to content

Bugfix redirect admin to his own report edition#543

Merged
kbeker merged 1 commit intomasterfrom
bugfix-admins-report-edition
Oct 19, 2019
Merged

Bugfix redirect admin to his own report edition#543
kbeker merged 1 commit intomasterfrom
bugfix-admins-report-edition

Conversation

@Karrp
Copy link
Contributor

@Karrp Karrp commented Oct 3, 2019

There is no issue fo this.

Fixes:

  • admin now can delete his own report like any other employee
  • after editing own report admin is redirected to "my reports" site

@Karrp Karrp added the bug Something isn't working label Oct 3, 2019
@Karrp Karrp self-assigned this Oct 3, 2019
Copy link
Contributor

@kbeker kbeker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should change condition for checking report owner. Also you have not implemented any test which also should be implemented.

{% if report.editable %}
<a href="{% if request.user.is_admin %}{% url 'admin-report-detail' pk=report.id %}{% else %}{% url 'custom-report-detail' pk=report.id %}{% endif %}" class="btn btn-light hidden-print">
{% if request.user.is_admin%}
{% if request.path == custom_report_list_url %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here should not be checked if this url match. Here should be checked if report which user want to edit is his. Please change this condition to check if this report is user's.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@Karrp Karrp requested a review from kbeker October 15, 2019 12:28
@kbeker kbeker changed the title Redirect admin to his own report edition Bugfix redirect admin to his own report edition Oct 19, 2019
@kbeker kbeker force-pushed the bugfix-admins-report-edition branch from 78ca768 to 95a0e6b Compare October 19, 2019 12:11
@kbeker kbeker merged commit 95a0e6b into master Oct 19, 2019
@kbeker kbeker deleted the bugfix-admins-report-edition branch October 19, 2019 12:14
@kbeker kbeker added this to the next_release milestone May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants