8

Four lines to one line

This commit is contained in:
Jasper Berghoef
2017-05-22 15:30:32 +02:00
committed by Boris Besemer
parent 4f114689a5
commit 33eabf4b77

View File

@@ -126,13 +126,10 @@ class SessionSegmentsAdapter(BaseSegmentsAdapter):
session_segments = self.request.session['segments'] session_segments = self.request.session['segments']
rules = AbstractBaseRule.__subclasses__() rules = AbstractBaseRule.__subclasses__()
new_segments = [] # Create a list to store the new requet session segments and
# re-apply all persistent segments.
# Re-apply all persistent segments, as long as they are still enabled. new_segments = [segment for segment in session_segments
for session_segment in session_segments: if segment in persistent_segments]
for persistent_segment in persistent_segments:
if persistent_segment.pk == session_segment['id']:
new_segments.append(session_segment)
# Run tests on all remaining enabled segments to verify applicability. # Run tests on all remaining enabled segments to verify applicability.
for segment in enabled_segments: for segment in enabled_segments: