Skip to content

Commit

Permalink
Merge pull request #37 from ambitioninc/develop
Browse files Browse the repository at this point in the history
Release 0.5.1
  • Loading branch information
jaredlewis committed Jan 19, 2016
2 parents d5b14c3 + d96595a commit 5d93049
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
16 changes: 3 additions & 13 deletions dynamic_initial_data/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def load_app(self, app):
return self.loaded_apps[app]

@atomic
def update_app(self, app, handle_deletions=True):
def update_app(self, app):
"""
Loads and runs `update_initial_data` of the specified app. Any dependencies contained within the
initial data class will be run recursively. Dependency cycles are checked for and a cache is built
Expand All @@ -122,7 +122,7 @@ def update_app(self, app, handle_deletions=True):

# update initial data of dependencies
for dependency in dependencies:
self.update_app(dependency, handle_deletions=False)
self.update_app(dependency)

self.log('Updating app {0}'.format(app))

Expand All @@ -139,11 +139,6 @@ def update_app(self, app, handle_deletions=True):
# keep track that this app has been updated
self.updated_apps.add(app)

# Handle deletions if necessary, this could be a single call that was nat batched with multiple updates
# We cannot handle this case yet since we do not know what app registered what deletions
# if handle_deletions:
# self.handle_deletions()

def handle_deletions(self):
"""
Manages handling deletions of objects that were previously managed by the initial data process but no longer
Expand Down Expand Up @@ -190,13 +185,8 @@ def update_all_apps(self):
Loops through all app names contained in settings.INSTALLED_APPS and calls `update_app`
on each one. Handles any object deletions that happened after all apps have been initialized.
"""

# Loop over all the apps and update each one, buffering the deletions until the end
for app in apps.get_app_configs():
self.update_app(
app=app.name,
handle_deletions=False
)
self.update_app(app.name)

# During update_app, all apps added model objects that were registered for deletion.
# Delete all objects that were previously managed by the initial data process
Expand Down
2 changes: 1 addition & 1 deletion dynamic_initial_data/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.5.3'
__version__ = '0.5.1'

0 comments on commit 5d93049

Please sign in to comment.