diff --git a/pagure-loadjson/pagure_loadjson_server.py b/pagure-loadjson/pagure_loadjson_server.py index 1a10a52..d00f4cd 100644 --- a/pagure-loadjson/pagure_loadjson_server.py +++ b/pagure-loadjson/pagure_loadjson_server.py @@ -158,7 +158,7 @@ def handle_messages(): _log.info('Looking for project: %s%s of user: %s', '%s/' % namespace if namespace else '', repo, username) - project = pagure.lib.get_project( + project = pagure.lib._get_project( session, repo, user=username, namespace=namespace) if not project: diff --git a/pagure-logcom/pagure_logcom_server.py b/pagure-logcom/pagure_logcom_server.py index 0861610..fdb4cb1 100644 --- a/pagure-logcom/pagure_logcom_server.py +++ b/pagure-logcom/pagure_logcom_server.py @@ -21,7 +21,6 @@ import json import logging import os -import requests import trollius import trollius_redis @@ -99,7 +98,7 @@ def handle_messages(): _log.info('Looking for project: %s%s of %s', '%s/' % namespacerepo if namespace else '', repo, username) - project = pagure.lib.get_project( + project = pagure.lib._get_project( pagure.SESSION, repo, user=username, namespace=namespace) if not project: diff --git a/pagure/api/fork.py b/pagure/api/fork.py index ad554b7..c009e8a 100644 --- a/pagure/api/fork.py +++ b/pagure/api/fork.py @@ -493,11 +493,7 @@ def api_pull_request_add_comment( "message": "Comment added" } -<<<<<<< a8fb3f131e9001d3b8a7952180d3f92540aea426 """ # noqa -======= - """ ->>>>>>> Fix using get_authorized_project in api/fork repo = pagure.get_authorized_project(SESSION, repo, user=username, namespace=namespace) output = {} diff --git a/pagure/hooks/files/pagure_hook_tickets.py b/pagure/hooks/files/pagure_hook_tickets.py index 84b1150..a0c847c 100755 --- a/pagure/hooks/files/pagure_hook_tickets.py +++ b/pagure/hooks/files/pagure_hook_tickets.py @@ -38,7 +38,7 @@ def run_as_post_receive_hook(): print('user:', username) print('namespace:', namespace) - project = pagure.lib.get_project( + project = pagure.lib._get_project( pagure.SESSION, repo, user=username, namespace=namespace) for line in sys.stdin: @@ -65,14 +65,14 @@ def run_as_post_receive_hook(): if REDIS: print('Sending to redis to load the data') REDIS.publish('pagure.loadjson', - json.dumps({ - 'project': project.to_json(public=True), - 'abspath': abspath, - 'commits': commits, - 'data_type': 'ticket', - 'agent': os.environ.get('GL_USER'), - } - )) + json.dumps({ + 'project': project.to_json(public=True), + 'abspath': abspath, + 'commits': commits, + 'data_type': 'ticket', + 'agent': os.environ.get('GL_USER'), + } + )) print( 'A report will be emailed to you once the load is finished') else: diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index c7077da..fd2b3f0 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -611,8 +611,6 @@ def add_issue_dependency( if not issue.private: #pagure.lib.notify.notify_assigned_issue(issue, user_obj) #pagure.lib.notify.notify_assigned_issue(issue_blocked, user_obj) - - if not issue.private: pagure.lib.notify.log( issue.project, topic='issue.dependency.added', @@ -672,8 +670,6 @@ def remove_issue_dependency( if not issue.private: #pagure.lib.notify.notify_assigned_issue(issue, user_obj) #pagure.lib.notify.notify_assigned_issue(issue_blocked, user_obj) - - if not issue.private: pagure.lib.notify.log( issue.project, topic='issue.dependency.removed', diff --git a/tests/test_pagure_flask_api_fork.py b/tests/test_pagure_flask_api_fork.py index 8a03857..ead44c9 100644 --- a/tests/test_pagure_flask_api_fork.py +++ b/tests/test_pagure_flask_api_fork.py @@ -607,8 +607,8 @@ class PagureFlaskApiForktests(tests.Modeltests): tests.create_tokens_acl(self.session) # Create the pull-request to close - repo = pagure.lib.get_project(self.session, 'test') - forked_repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') + forked_repo = pagure.get_authorized_project(self.session, 'test') req = pagure.lib.new_pull_request( session=self.session, repo_from=forked_repo, @@ -871,8 +871,8 @@ class PagureFlaskApiForktests(tests.Modeltests): ) # Create a pull-request - repo = pagure.lib.get_project(self.session, 'test') - forked_repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') + forked_repo = pagure.get_authorized_project(self.session, 'test') req = pagure.lib.new_pull_request( session=self.session, repo_from=forked_repo, @@ -1129,8 +1129,8 @@ class PagureFlaskApiForktests(tests.Modeltests): ) # Create a pull-request - repo = pagure.lib.get_project(self.session, 'test') - forked_repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') + forked_repo = pagure.get_authorized_project(self.session, 'test') req = pagure.lib.new_pull_request( session=self.session, repo_from=forked_repo, diff --git a/tests/test_pagure_flask_api_issue.py b/tests/test_pagure_flask_api_issue.py index 82c3ebe..46b1d16 100644 --- a/tests/test_pagure_flask_api_issue.py +++ b/tests/test_pagure_flask_api_issue.py @@ -838,7 +838,7 @@ class PagureFlaskApiIssuetests(tests.Modeltests): ) # Create private issue - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') msg = pagure.lib.new_issue( session=self.session, repo=repo, @@ -1095,7 +1095,7 @@ class PagureFlaskApiIssuetests(tests.Modeltests): tests.create_tokens(self.session) tests.create_tokens_acl(self.session) - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') # Create 2 tickets but only 1 has a milestone start = datetime.datetime.utcnow().strftime('%s') @@ -1186,7 +1186,7 @@ class PagureFlaskApiIssuetests(tests.Modeltests): tests.create_tokens(self.session) tests.create_tokens_acl(self.session) - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') # Create 2 tickets but only 1 has a priority start = datetime.datetime.utcnow().strftime('%s') @@ -1328,7 +1328,7 @@ class PagureFlaskApiIssuetests(tests.Modeltests): tests.create_tokens(self.session) tests.create_tokens_acl(self.session) - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') # Create 2 tickets but only 1 has a milestone start = datetime.datetime.utcnow().strftime('%s') @@ -1443,7 +1443,7 @@ class PagureFlaskApiIssuetests(tests.Modeltests): tests.create_tokens(self.session) tests.create_tokens_acl(self.session) - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') # Create 1st tickets start = datetime.datetime.utcnow().strftime('%s') @@ -2470,7 +2470,7 @@ class PagureFlaskApiIssuetests(tests.Modeltests): ) # Create normal issue - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') msg = pagure.lib.new_issue( session=self.session, repo=repo, @@ -2485,7 +2485,7 @@ class PagureFlaskApiIssuetests(tests.Modeltests): self.assertEqual(msg.title, 'Test issue #1') # Check comments before - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') issue = pagure.lib.search_issues(self.session, repo, issueid=1) self.assertEqual(len(issue.comments), 0) @@ -2508,7 +2508,7 @@ class PagureFlaskApiIssuetests(tests.Modeltests): ) # No change - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') issue = pagure.lib.search_issues(self.session, repo, issueid=1) self.assertEqual(issue.status, 'Open') @@ -2527,7 +2527,7 @@ class PagureFlaskApiIssuetests(tests.Modeltests): ) # One comment added - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') issue = pagure.lib.search_issues(self.session, repo, issueid=1) self.assertEqual(len(issue.comments), 1) @@ -2561,7 +2561,7 @@ class PagureFlaskApiIssuetests(tests.Modeltests): self.session.add(item) self.session.commit() - repo = pagure.lib.get_project(self.session, 'foo') + repo = pagure.get_authorized_project(self.session, 'foo') # Create private issue msg = pagure.lib.new_issue( session=self.session, @@ -2577,7 +2577,7 @@ class PagureFlaskApiIssuetests(tests.Modeltests): self.assertEqual(msg.title, 'Test issue') # Check before - repo = pagure.lib.get_project(self.session, 'foo') + repo = pagure.get_authorized_project(self.session, 'foo') issue = pagure.lib.search_issues(self.session, repo, issueid=1) self.assertEqual(len(issue.comments), 0) @@ -2596,7 +2596,7 @@ class PagureFlaskApiIssuetests(tests.Modeltests): self.assertEqual(pagure.api.APIERROR.EINVALIDTOK.value, data['error']) # No comment added - repo = pagure.lib.get_project(self.session, 'foo') + repo = pagure.get_authorized_project(self.session, 'foo') issue = pagure.lib.search_issues(self.session, repo, issueid=1) self.assertEqual(len(issue.comments), 0) diff --git a/tests/test_pagure_flask_api_ui_private_repo.py b/tests/test_pagure_flask_api_ui_private_repo.py index b08cc14..42754f9 100644 --- a/tests/test_pagure_flask_api_ui_private_repo.py +++ b/tests/test_pagure_flask_api_ui_private_repo.py @@ -1904,6 +1904,9 @@ class PagurePrivateRepotest(tests.Modeltests): "args": { "assignee": None, "author": None, + "milestones": [], + "no_stones": None, + "priority": None, "since": None, "status": None, "tags": [] @@ -1969,6 +1972,9 @@ class PagurePrivateRepotest(tests.Modeltests): "args": { "assignee": None, "author": None, + "milestones": [], + "no_stones": None, + "priority": None, "status": None, "since": None, "tags": [] @@ -2047,6 +2053,9 @@ class PagurePrivateRepotest(tests.Modeltests): "args": { "assignee": None, "author": None, + "milestones": [], + "no_stones": None, + "priority": None, "status": None, "since": None, "tags": [] @@ -2115,6 +2124,9 @@ class PagurePrivateRepotest(tests.Modeltests): "args": { "assignee": None, "author": None, + "milestones": [], + "no_stones": None, + "priority": None, "status": "Closed", "since": None, "tags": [] @@ -2135,6 +2147,9 @@ class PagurePrivateRepotest(tests.Modeltests): "args": { "assignee": None, "author": None, + "milestones": [], + "no_stones": None, + "priority": None, "status": "Invalid", "since": None, "tags": [] @@ -2159,6 +2174,9 @@ class PagurePrivateRepotest(tests.Modeltests): "args": { "assignee": None, "author": None, + "milestones": [], + "no_stones": None, + "priority": None, "since": None, "status": "All", "tags": [] diff --git a/tests/test_pagure_flask_docs.py b/tests/test_pagure_flask_docs.py index 3817f4c..bae1c3d 100644 --- a/tests/test_pagure_flask_docs.py +++ b/tests/test_pagure_flask_docs.py @@ -103,7 +103,7 @@ class PagureFlaskDocstests(tests.Modeltests): PagureRepo.push(remote, 'refs/heads/master:refs/heads/master') # Turn on the docs project since it's off by default - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') repo.settings = {'project_documentation': True} self.session.add(repo) self.session.commit() diff --git a/tests/test_pagure_flask_internal.py b/tests/test_pagure_flask_internal.py index 017f286..8848cfd 100644 --- a/tests/test_pagure_flask_internal.py +++ b/tests/test_pagure_flask_internal.py @@ -307,7 +307,7 @@ class PagureFlaskInternaltests(tests.Modeltests): tests.create_projects(self.session) # Create issues to play with - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') msg = pagure.lib.new_issue( session=self.session, repo=repo, @@ -320,7 +320,7 @@ class PagureFlaskInternaltests(tests.Modeltests): self.session.commit() self.assertEqual(msg.title, 'Test issue') - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') issue = repo.issues[0] self.assertEqual(len(issue.comments), 0) @@ -336,7 +336,7 @@ class PagureFlaskInternaltests(tests.Modeltests): output = self.app.put('/pv/ticket/comment/', data=data) self.assertEqual(output.status_code, 403) - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') # Let's promote him to be a ticketer # He shoudn't be able to comment even then though msg = pagure.lib.add_user_to_project( @@ -348,7 +348,7 @@ class PagureFlaskInternaltests(tests.Modeltests): ) self.session.commit() self.assertEqual(msg, 'User added') - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') self.assertEqual( sorted([u.username for u in repo.users]), ['foo']) self.assertEqual( @@ -359,7 +359,7 @@ class PagureFlaskInternaltests(tests.Modeltests): output = self.app.put('/pv/ticket/comment/', data=data) self.assertEqual(output.status_code, 403) - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') # Let's promote him to be a committer # He should be able to comment msg = pagure.lib.add_user_to_project( @@ -371,7 +371,7 @@ class PagureFlaskInternaltests(tests.Modeltests): ) self.session.commit() self.assertEqual(msg, 'User access updated') - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') self.assertEqual( sorted([u.username for u in repo.users]), ['foo']) self.assertEqual( @@ -385,7 +385,7 @@ class PagureFlaskInternaltests(tests.Modeltests): js_data = json.loads(output.data) self.assertDictEqual(js_data, {'message': 'Comment added'}) - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') issue = repo.issues[0] self.assertEqual(len(issue.comments), 1) @@ -401,7 +401,7 @@ class PagureFlaskInternaltests(tests.Modeltests): self.session.commit() self.assertEqual(msg, 'User access updated') - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') self.assertEqual( sorted([u.username for u in repo.users]), ['foo']) self.assertEqual( @@ -415,7 +415,7 @@ class PagureFlaskInternaltests(tests.Modeltests): js_data = json.loads(output.data) self.assertDictEqual(js_data, {'message': 'Comment added'}) - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') issue = repo.issues[0] self.assertEqual(len(issue.comments), 2) diff --git a/tests/test_pagure_flask_ui_fork.py b/tests/test_pagure_flask_ui_fork.py index 95d621f..ca77241 100644 --- a/tests/test_pagure_flask_ui_fork.py +++ b/tests/test_pagure_flask_ui_fork.py @@ -1467,8 +1467,8 @@ index 0000000..2a552bb tests.create_projects_git( os.path.join(self.path, 'requests'), bare=True) - repo = pagure.lib.get_project(self.session, 'test') - fork = pagure.lib.get_project(self.session, 'test', user='foo') + repo = pagure.get_authorized_project(self.session, 'test') + fork = pagure.get_authorized_project(self.session, 'test', user='foo') self.set_up_git_repo( new_project=fork, branch_from='feature', mtype='FF') diff --git a/tests/test_pagure_flask_ui_issues.py b/tests/test_pagure_flask_ui_issues.py index 3b86678..b89f2a4 100644 --- a/tests/test_pagure_flask_ui_issues.py +++ b/tests/test_pagure_flask_ui_issues.py @@ -889,7 +889,7 @@ class PagureFlaskIssuestests(tests.Modeltests): tests.create_projects_git( os.path.join(self.path), bare=True) - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') # Add custom fields to the project msg = pagure.lib.set_custom_key_fields( diff --git a/tests/test_pagure_flask_ui_issues_acl_checks.py b/tests/test_pagure_flask_ui_issues_acl_checks.py index 41f7c69..92ecf45 100644 --- a/tests/test_pagure_flask_ui_issues_acl_checks.py +++ b/tests/test_pagure_flask_ui_issues_acl_checks.py @@ -74,7 +74,7 @@ class PagureFlaskIssuesACLtests(tests.Modeltests): self.assertEqual(output.status_code, 404) # Create issues to play with - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') msg = pagure.lib.new_issue( session=self.session, repo=repo, @@ -268,7 +268,7 @@ class PagureFlaskIssuesACLtests(tests.Modeltests): output.data) # Create private issue - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') msg = pagure.lib.new_issue( session=self.session, repo=repo, @@ -325,7 +325,7 @@ class PagureFlaskIssuesACLtests(tests.Modeltests): self.assertEqual(output.status_code, 404) # Create issues to play with - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') # Add user 'foo' with ticket access on repo msg = pagure.lib.add_user_to_project( @@ -338,7 +338,7 @@ class PagureFlaskIssuesACLtests(tests.Modeltests): self.assertEqual(msg, 'User added') self.session.commit() - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') msg = pagure.lib.new_issue( session=self.session, repo=repo, @@ -531,7 +531,7 @@ class PagureFlaskIssuesACLtests(tests.Modeltests): output.data) # Create private issue - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') msg = pagure.lib.new_issue( session=self.session, repo=repo, @@ -588,7 +588,7 @@ class PagureFlaskIssuesACLtests(tests.Modeltests): self.assertEqual(output.status_code, 404) # Create issues to play with - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') # Add user 'foo' with ticket access on repo msg = pagure.lib.add_user_to_project( @@ -601,7 +601,7 @@ class PagureFlaskIssuesACLtests(tests.Modeltests): self.assertEqual(msg, 'User added') self.session.commit() - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') msg = pagure.lib.new_issue( session=self.session, repo=repo, @@ -793,7 +793,7 @@ class PagureFlaskIssuesACLtests(tests.Modeltests): output.data) # Create private issue - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') msg = pagure.lib.new_issue( session=self.session, repo=repo, @@ -850,7 +850,7 @@ class PagureFlaskIssuesACLtests(tests.Modeltests): self.assertEqual(output.status_code, 404) # Create issues to play with - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') # Add user 'foo' with ticket access on repo msg = pagure.lib.add_user_to_project( @@ -863,7 +863,7 @@ class PagureFlaskIssuesACLtests(tests.Modeltests): self.assertEqual(msg, 'User added') self.session.commit() - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') msg = pagure.lib.new_issue( session=self.session, repo=repo, @@ -1056,7 +1056,7 @@ class PagureFlaskIssuesACLtests(tests.Modeltests): output.data) # Create private issue - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') msg = pagure.lib.new_issue( session=self.session, repo=repo, diff --git a/tests/test_pagure_flask_ui_repo.py b/tests/test_pagure_flask_ui_repo.py index f72770b..642b227 100644 --- a/tests/test_pagure_flask_ui_repo.py +++ b/tests/test_pagure_flask_ui_repo.py @@ -3033,7 +3033,7 @@ index 0000000..fb7093d output.data) # add user - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') msg = pagure.lib.add_user_to_project( session=self.session, project=repo, @@ -3052,9 +3052,9 @@ index 0000000..fb7093d self.assertIn( 'Forks 0', output.data) - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') self.assertNotEqual(repo, None) - repo = pagure.lib.get_project(self.session, 'test2') + repo = pagure.get_authorized_project(self.session, 'test2') self.assertEqual(repo, None) # Delete the project @@ -3068,9 +3068,9 @@ index 0000000..fb7093d output.data) # Check after - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') self.assertEqual(repo, None) - repo = pagure.lib.get_project(self.session, 'test2') + repo = pagure.get_authorized_project(self.session, 'test2') self.assertEqual(repo, None) @patch('pagure.lib.notify.send_email') @@ -3127,7 +3127,7 @@ index 0000000..fb7093d self.assertEqual(msg, 'User `pingou` added to the group `foo`.') # Add group to the project - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') msg = pagure.lib.add_group_to_project( session=self.session, project=repo, @@ -3138,7 +3138,7 @@ index 0000000..fb7093d self.assertEqual(msg, 'Group added') # check if group where we expect it - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') self.assertEqual(len(repo.projects_groups), 1) # Check before deleting the project @@ -3150,7 +3150,7 @@ index 0000000..fb7093d self.assertIn( 'Forks 0', output.data) - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') self.assertNotEqual(repo, None) # Delete the project @@ -3164,7 +3164,7 @@ index 0000000..fb7093d output.data) # Check after - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') self.assertEqual(repo, None) @patch('pagure.lib.notify.send_email') @@ -3207,7 +3207,7 @@ index 0000000..fb7093d output.data) # Create the issue - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') msg = pagure.lib.new_issue( session=self.session, repo=repo, @@ -3220,7 +3220,7 @@ index 0000000..fb7093d self.assertEqual(msg.title, 'Test issue') # Add a tag to the issue - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') issue = pagure.lib.search_issues(self.session, repo, issueid=1) msg = pagure.lib.add_tag_obj( session=self.session, @@ -3240,9 +3240,9 @@ index 0000000..fb7093d self.assertIn( 'Forks 0', output.data) - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') self.assertNotEqual(repo, None) - repo = pagure.lib.get_project(self.session, 'test2') + repo = pagure.get_authorized_project(self.session, 'test2') self.assertEqual(repo, None) # Delete the project @@ -3256,9 +3256,9 @@ index 0000000..fb7093d output.data) # Check after - repo = pagure.lib.get_project(self.session, 'test') + repo = pagure.get_authorized_project(self.session, 'test') self.assertEqual(repo, None) - repo = pagure.lib.get_project(self.session, 'test2') + repo = pagure.get_authorized_project(self.session, 'test2') self.assertEqual(repo, None) @patch('pagure.ui.repo.admin_session_timedout') @@ -4224,7 +4224,7 @@ index 0000000..fb7093d output.data) # Create a report - project = pagure.lib.get_project(self.session, name='test') + project = pagure.get_authorized_project(self.session, project_name='test') self.assertEqual(project.reports, {}) name = 'test report' url = '?foo=bar&baz=biz' @@ -4236,7 +4236,7 @@ index 0000000..fb7093d username=None ) self.session.commit() - project = pagure.lib.get_project(self.session, name='test') + project = pagure.get_authorized_project(self.session, project_name='test') self.assertEqual( project.reports, {'test report': {'baz': 'biz', 'foo': 'bar'}} @@ -4253,7 +4253,7 @@ index 0000000..fb7093d '