handler_purge_permissions now call module manager
Update handler_purge_permissions to call the purge_obsolete model manager method instead of the management command. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.core import management
|
||||
from django.apps import apps
|
||||
|
||||
|
||||
def handler_purge_permissions(**kwargs):
|
||||
management.call_command(command_name='purgepermissions')
|
||||
StoredPermission = apps.get_model(
|
||||
app_label='permissions', model_name='StoredPermission'
|
||||
)
|
||||
|
||||
StoredPermission.objects.purge_obsolete()
|
||||
|
||||
Reference in New Issue
Block a user