Skip to content

Commit c29636e

Browse files
committed
Fix style
1 parent f46abb5 commit c29636e

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

readthedocs/core/signals.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# -*- coding: utf-8 -*-
2+
13
"""Signal handling for core app."""
24

35
from __future__ import absolute_import
@@ -24,7 +26,6 @@
2426
'/api/v2/sustainability',
2527
]
2628

27-
2829
webhook_github = Signal(providing_args=['project', 'data', 'event'])
2930
webhook_gitlab = Signal(providing_args=['project', 'data', 'event'])
3031
webhook_bitbucket = Signal(providing_args=['project', 'data', 'event'])
@@ -83,14 +84,17 @@ def delete_projects_and_organizations(sender, instance, *args, **kwargs):
8384
# Add annotate before filter
8485
# https://github.com/rtfd/readthedocs.org/pull/4577
8586
# https://docs.djangoproject.com/en/2.1/topics/db/aggregation/#order-of-annotate-and-filter-clauses # noqa
86-
projects = (Project.objects.annotate(num_users=Count('users')).filter(users=instance.id)
87-
.exclude(num_users__gt=1))
87+
projects = (
88+
Project.objects.annotate(num_users=Count('users'))
89+
.filter(users=instance.id).exclude(num_users__gt=1)
90+
)
8891

8992
# Here we count the users list from the organization that the user belong
9093
# Then exclude the organizations where there are more than one user
91-
oauth_organizations = (RemoteOrganization.objects.annotate(num_users=Count('users'))
92-
.filter(users=instance.id)
93-
.exclude(num_users__gt=1))
94+
oauth_organizations = (
95+
RemoteOrganization.objects.annotate(num_users=Count('users'))
96+
.filter(users=instance.id).exclude(num_users__gt=1)
97+
)
9498

9599
projects.delete()
96100
oauth_organizations.delete()

0 commit comments

Comments
 (0)