Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
suejung-sentry committed Jan 30, 2025
1 parent f1eddb4 commit a001d68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tasks/sync_teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ def run_impl(self, db_session, ownerid, *, username=None, **kwargs):
),
)
for org_ownerid in removed_orgs:
org = db_session.query(Owner).filter(Owner.ownerid == org_ownerid).first()
org = (
db_session.query(Owner).filter(Owner.ownerid == org_ownerid).first()
)
if org and ownerid in org.plan_activated_users:
log.info(

Check warning on line 66 in tasks/sync_teams.py

View check run for this annotation

Codecov Notifications / codecov/patch

tasks/sync_teams.py#L66

Added line #L66 was not covered by tests
"Removing user from org's plan_activated_users",
extra=dict(user_ownerid=ownerid, org_ownerid=org_ownerid)
extra=dict(user_ownerid=ownerid, org_ownerid=org_ownerid),
)
org.plan_activated_users.remove(ownerid)

Check warning on line 70 in tasks/sync_teams.py

View check run for this annotation

Codecov Notifications / codecov/patch

tasks/sync_teams.py#L70

Added line #L70 was not covered by tests

Expand Down
1 change: 1 addition & 0 deletions tasks/tests/unit/test_sync_teams_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def test_team_removed(self, mocker, mock_configuration, dbsession, codecov_vcr):
)
prev_team.plan_activated_users = [user.ownerid]
dbsession.add(user)
dbsession.add(prev_team)
dbsession.flush()
SyncTeamsTask().run_impl(dbsession, user.ownerid, using_integration=False)
assert prev_team.ownerid not in user.organizations
Expand Down

0 comments on commit a001d68

Please sign in to comment.