Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix permissions for homepage Abort/Delete buttons #596

Merged
merged 2 commits into from
Feb 25, 2016

Conversation

lukeyeager
Copy link
Member

No description provided.

@lukeyeager
Copy link
Member Author

I had to add a strange fix (suggested in this SO post) for this error:

ERROR: digits.test_scheduler.TestSchedulerFlow.test_add_remove_job
    RuntimeError: working outside of request context

Actually, this is required to run digits/test_scheduler.py by itself even without this PR. Otherwise, you get this error:

FAIL: digits.test_scheduler.TestScheduler.test_start_twice
    AssertionError: failed to stop

{% endif %}
{% if job | has_permission('delete') %}
<a id="delete" class="btn btn-xs btn-danger" {{ ' style=display:none;' if job.status.is_running() }} onClick="return deleteJob('{{job.id()}}');">Delete</a>
{% endif %}
Copy link
Contributor

Choose a reason for hiding this comment

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

unrelated but why does the job have to not be running to display the delete button? On the job page there is no such limitation.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good question. Maybe it fits better? @jmancewicz?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I had it that way, because initially jobs in that list were removed once they completed. I was probably looking to avoid having Abort and Delete visible, and those conditions worked in the initial case.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I'll change it in a separate PR.

@gheinrich
Copy link
Contributor

Looks good to me and is working for me.

lukeyeager added a commit that referenced this pull request Feb 25, 2016
Fix permissions for homepage Abort/Delete buttons
@lukeyeager lukeyeager merged commit 982bcae into NVIDIA:master Feb 25, 2016
@lukeyeager lukeyeager deleted the fix-home-page-permissions branch February 25, 2016 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants