#1367 Do not call the API if issue or pull-requests are disabled and we know it
Merged by pingou. Opened by pingou.
drop_unneeded_calls  into  master

Download 1367.patch

Fixes https://pagure.io/pagure/issue/1364

So this PR does two things:

  • Ensure the @ and # can be used when writing the initial comment of a PR
  • Reduce the code duplication by ensuring that we always have two objects passed onto the .done() function and then by adjusting the behavior of the method based on these two objects (if they are defined or not).

1 new commit added

  • Fix setting name, we want to check the PR settings to load PRs

Should this be if repo.settings.get('pull_requests', True)?

2 new commits added

  • Remove redundant code and ensure # and @ can be used in the initial comment
  • Ensure we always pass two object to the .done() function

1 new commit added

  • Drop left over debugging code

:thumbsup:

I can wrong here but shouldn't this be $('div') ?

Other that the comments rest looks good to me.

After local test, I can assure that it works as is and doesn't if I use $('div') (which pretty much breaks the entire page ^^)

Going to rebase and merge :)

rebased

Pull-Request has been merged by pingou

Metadata