From 6b02a24374cb75555cd54e1e4333db2bc3fa408b Mon Sep 17 00:00:00 2001 From: "Mr. Senko" Date: Thu, 27 Aug 2020 00:45:34 +0300 Subject: [PATCH] Remove a redundant if condition in Resync() b/c find_installations() filters by `tenant_pk' if it returns 1 record it means it has already been configured. This if condition is not needed b/c it checks whether or not the AppInst is configured which were sure it is. --- tcms_github_app/views.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/tcms_github_app/views.py b/tcms_github_app/views.py index dd7f631..881954f 100644 --- a/tcms_github_app/views.py +++ b/tcms_github_app/views.py @@ -112,16 +112,8 @@ def get(self, request, *args, **kwargs): ) return HttpResponseRedirect('/') + # user .first() b/c the result is a query set installation = installations.first() - if not installation.tenant_pk: - messages.add_message( - request, - messages.WARNING, - _('Unconfigured GitHub App %d') % installation.installation, - ) - return HttpResponseRedirect('/') - - # finally start syncing utils.resync(request, installation) return HttpResponseRedirect('/')