mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
maintain env config when admin sorting tree
This commit is contained in:
@@ -91,10 +91,11 @@ admin.site.register(SyncLog, SyncLogAdmin)
|
||||
|
||||
@admin.action(description='Fix problems and sort tree by name')
|
||||
def sort_tree(modeladmin, request, queryset):
|
||||
orginal_value = modeladmin.model.node_order_by[:]
|
||||
modeladmin.model.node_order_by = ['name']
|
||||
with scopes_disabled():
|
||||
Keyword.fix_tree(fix_paths=True)
|
||||
modeladmin.model.node_order_by = []
|
||||
modeladmin.model.node_order_by = orginal_value
|
||||
|
||||
|
||||
class KeywordAdmin(TreeAdmin):
|
||||
|
||||
Reference in New Issue
Block a user