Skip to content

Commit

Permalink
Merge pull request #5825 from nyaruka/simplify-test-login
Browse files Browse the repository at this point in the history
Simplify test login
  • Loading branch information
rowanseymour authored Jan 24, 2025
2 parents 04785fc + 1a1406b commit 5a16393
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions temba/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,7 @@ def login(self, user, *, update_last_auth_on: bool = True, choose_org=None):

# infer our org if we weren't handed one
if not choose_org:
orgs = user.orgs.filter(is_active=True).order_by("-created_on")
if orgs.count() > 0:
# take the newest one
choose_org = orgs[0]
choose_org = user.orgs.filter(is_active=True).order_by("-created_on").first()

if update_last_auth_on:
user.record_auth()
Expand Down

0 comments on commit 5a16393

Please sign in to comment.