Don't send source_saved when no source

Fixes #214 and the failing test from 404fed5
This commit is contained in:
Matthew Tretter 2013-05-25 00:19:14 -04:00
parent 404fed58ec
commit 535e68aea6

View file

@ -93,7 +93,7 @@ class ModelSignalRouter(object):
old_hashes = instance._ik.get('source_hashes', {}).copy()
new_hashes = self.update_source_hashes(instance)
for attname, file in self.get_field_dict(instance).items():
if created or old_hashes[attname] != new_hashes[attname]:
if file and old_hashes[attname] != new_hashes[attname]:
self.dispatch_signal(source_saved, file, sender, instance,
attname)