Commits

Jaap Roes committed 56d523f

Save the node when moving, to trigger save handlers, signals etc. Small whitespace fix.

Comments (0)

Files changed (1)

treebeard/admin.py

                 # If it happened because the node is not a 'sorted-sibling' or 
                 # 'sorted-child' then try to move just a child without preserving the
                 # order, so try a different move
-                if  as_child:
+                if as_child:
                     try:
                         # Try as unsorted tree
                         node.move(sibling, pos='last-child')
                 else:
                     node.move(sibling)
 
-            # If we are here, means that we moved it in onf of the tries
+            # Call the save method on the (reloaded) node in order to trigger
+            # possible signal handlers etc.
+            node = self.model.objects.get(pk=node.pk)
+            node.save()
+            # If we are here, means that we moved it in one of the tries
             messages.info(request, u'Moved node "%s" as %s of "%s"' % (node,
                 ('sibling', 'child')[as_child], sibling))
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.