X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/6d66ceff54d470d238250c73ab484d496bf296db..ddfd0025304ea7087fdd2a4e06893a6f998b9f19:/apps/explorer/views.py diff --git a/apps/explorer/views.py b/apps/explorer/views.py index 82376fc1..124a5743 100644 --- a/apps/explorer/views.py +++ b/apps/explorer/views.py @@ -147,6 +147,14 @@ def _get_issues_for_file(fileid): # ================= # = Pull requests = # ================= -#def pull_requests(request): -# return direct_to_template(request, 'manager/pull_request.html', extra_context = { -# 'objects': models.PullRequest.objects.all()} ) +def pull_requests(request): + from explorer.models import PullRequest + + objects = PullRequest.objects.order_by('status') + + if not request.user.has_perm('explorer.book.can_share'): + objects = objects.filter(comitter=request.user) + + + return direct_to_template(request, 'manager/pull_request.html', + extra_context = {'objects': objects} )