Skip to content

Commit

Permalink
If transports and location already mapped skip autoadd
Browse files Browse the repository at this point in the history
  • Loading branch information
pigmej committed Sep 24, 2015
1 parent a442295 commit e6288cd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions solar/solar/core/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ def _remove_from_mapping(single):
elif isinstance(orig_mapping, set):
orig_mapping.remove(single)

def _single(single):
def _single(single, inps_emitter, inps_receiver):
if inps_emitter and inps_receiver:
log.debug("location and transports different, skipping")
return
emitter_single = emitter.db_obj.meta_inputs[single]
receiver_single = receiver.db_obj.meta_inputs[single]
emitter_single_reverse = emitter_single.get('reverse')
Expand All @@ -76,9 +79,11 @@ def _single(single):
if isinstance(orig_mapping, dict):
orig_mapping[single] = single

inps_emitter = emitter.args
inps_receiver = receiver.args
# XXX: should be somehow parametrized (input attribute?)
for single in ('transports_id', 'location_id'):
_single(single)
_single(single, inps_emitter[single], inps_receiver[single])
return


Expand Down

0 comments on commit e6288cd

Please sign in to comment.