Skip to content

Commit

Permalink
Remove a redundant if condition in Resync()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
atodorov committed Aug 26, 2020
1 parent 3ee976e commit 6b02a24
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions tcms_github_app/views.py
Expand Up @@ -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('/')

Expand Down

0 comments on commit 6b02a24

Please sign in to comment.