Skip to content

Commit e7010f6

Browse files
committed
Bugfix in compare_qso()
1 parent 0e969b7 commit e7010f6

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

edi.py

+13-6
Original file line numberDiff line numberDiff line change
@@ -846,8 +846,8 @@ def crosscheck_logs(operator_instances, rules, band_nr):
846846
continue
847847

848848
# validate that this qso wasn't already validated
849-
_, inside_period_nr = qso1.qso_inside_period()
850-
if '{}-period{}'.format(callsign2, inside_period_nr) in _had_qso_with:
849+
_, inside_period_nr1 = qso1.qso_inside_period()
850+
if '{}-period{}'.format(callsign2, inside_period_nr1) in _had_qso_with:
851851
qso1.cc_confirmed = False
852852
qso1.cc_error = 'Qso already confirmed'
853853
continue
@@ -868,20 +868,27 @@ def crosscheck_logs(operator_instances, rules, band_nr):
868868
_callsign = qso2.qso_fields['call']
869869
if callsign1 != _callsign:
870870
continue
871+
872+
_, inside_period_nr2 = qso2.qso_inside_period()
873+
if inside_period_nr1 != inside_period_nr2:
874+
continue
875+
871876
distance = None
872877
try:
873878
distance = compare_qso(log1, qso1, log2, qso2)
874879
except ValueError as e:
880+
qso1.cc_confirmed = False
875881
qso1.cc_error = e
882+
continue
876883

877884
if distance is None:
878885
continue
879886

880887
# add this qso in _had_qso_with list
881-
_, inside_period_nr = qso2.qso_inside_period()
882-
_had_qso_with.append('{}-period{}'.format(callsign2, inside_period_nr))
888+
_had_qso_with.append('{}-period{}'.format(callsign2, inside_period_nr2))
883889
qso1.points = distance * int(rules.contest_band(band_nr)['multiplier'])
884890
qso1.cc_confirmed = True
891+
break
885892

886893

887894
def compare_qso(log1, qso1, log2, qso2):
@@ -941,8 +948,8 @@ def compare_qso(log1, qso1, log2, qso2):
941948
raise ValueError('Serial number mismatch')
942949

943950
# compare qth
944-
if (log1.maidenhead_locator != qso2.qso_fields['wwl'] or \
945-
log2.maidenhead_locator != qso1.qso_fields['wwl']):
951+
if log1.maidenhead_locator != qso2.qso_fields['wwl'] or \
952+
log2.maidenhead_locator != qso1.qso_fields['wwl']:
946953
raise ValueError('Qth locator mismatch')
947954

948955
# calculate & return distance

0 commit comments

Comments
 (0)