title: list index out of range Django overlapping
body: <p>Hi When I am checking overalapping i am getting list index out of range,
  how i can solve that ,</p>
  <pre><code> for i in range(count):
          start_value=(self.data.get(f'applicationvalue_set-{i}-start_value', []))
          end_value=(self.data.get(f'applicationvalue_set-{i}-end_value', []))
          if start_value is not None or end_value is not None:
              value1=[]
              value2=[]
              for start in start_value:
                  if start not in value1:
                      value1.append(start)
              for end in end_value:
                  if end not in value2:
                      value2.append(end)
              a=range(value1[0],value1[-1])
  
              b=range(value2[0],value2[-1])
              if a in b.exists():
                   raise ValidationError(&quot;overlap not allowed&quot;)djangp
  </code></pre>