0003-provisionning-delete-superfluous-roles-in-one-query-.patch
hobo/provisionning/utils.py | ||
---|---|---|
177 | 177 |
logger.error(u'cannot provision role "%s" (%s)', o['name'], o['uuid']) |
178 | 178 |
continue |
179 | 179 |
if full and action == 'provision': |
180 |
for role in Role.objects.exclude(uuid__in=uuids): |
|
181 |
role.delete() |
|
180 |
Role.objects.exclude(uuid__in=uuids).delete() |
|
182 | 181 |
elif action == 'deprovision': |
183 | 182 |
for role in Role.objects.filter(uuid__in=uuids): |
184 | 183 |
role.delete() |
tests_multitenant/test_hobo_notify.py | ||
---|---|---|
268 | 268 |
} |
269 | 269 |
with CaptureQueriesContext(connection) as ctx: |
270 | 270 |
Command.process_notification(tenant, notification) |
271 |
assert len(ctx.captured_queries) == 45
|
|
271 |
assert len(ctx.captured_queries) == 33
|
|
272 | 272 |
assert Group.objects.count() == 1 |
273 | 273 |
assert Role.objects.count() == 1 |
274 | 274 | |
275 |
- |