Skip to content

Commit

Permalink
Drop useless if statement
Browse files Browse the repository at this point in the history
this is leftover from a recent PR

CC @RMadjev
  • Loading branch information
atodorov committed Sep 11, 2019
1 parent 017eb3d commit 50bb83b
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions tcms/testruns/views.py
Expand Up @@ -605,16 +605,15 @@ def get(self, request, run_id):
username_or_email = request.GET.get('user')
context_data = {'test_run': test_run, 'is_ajax': True}

if action:
try:
user = User.objects.get(
Q(username=username_or_email) |
Q(email=username_or_email)
)
context_data['message'] = ''
except ObjectDoesNotExist:
context_data['message'] = _('The user you typed does not exist in database')
return render(request, self.template_name, context_data)
try:
user = User.objects.get(
Q(username=username_or_email) |
Q(email=username_or_email)
)
context_data['message'] = ''
except ObjectDoesNotExist:
context_data['message'] = _('The user you typed does not exist in database')
return render(request, self.template_name, context_data)

if action == 'add':
test_run.add_cc(user=user)
Expand Down

0 comments on commit 50bb83b

Please sign in to comment.