585cb0b16a
clean out some python2-isms
2019-03-15 11:50:34 +01:00
956c1bf4f5
Use timezone-aware dates and times in rules ( #197 )
...
* use timezone-aware dates and times re #196
* remove redundant newlines
* Fix flake8 linting errors in python 3.6
2019-01-24 16:27:34 +01:00
0bdb80f25a
improve SessionSegmentAdapter
2018-05-26 16:04:11 +02:00
8a151e3bab
python2 cleanups
2018-05-26 12:06:35 +02:00
9710d3b479
post-merge cleanups
2018-05-26 11:45:28 +02:00
ea1ecc2a98
Get excluded segments from session and don't check them again
2018-02-12 18:00:38 +02:00
0f0aecf673
Store excluded segments in the session object
2018-02-12 17:57:36 +02:00
c11960f921
Only store excluded users for static segments
2018-02-12 16:58:20 +02:00
521222f748
Don't check if excluded users match segment rules
2018-02-09 12:35:53 +02:00
56a8e106d8
Add users excluded by randomisation to excluded_users list
2018-02-09 12:35:09 +02:00
d114bb2570
Always add the segment to the session if they pass
2018-02-08 19:47:35 +02:00
7200b5b4c4
If a session passes segment rules randomise them into the segement
2018-02-05 12:19:36 +02:00
e3488e87ad
Enable and fix lint
2018-01-08 09:08:11 +00:00
0a42ce3eeb
Fix not updating visitor count rule properly
2017-11-23 14:10:16 +00:00
1f4a4536ab
Make the static elements tracked users only
...
We cannot track anonymous users as the session expires after 10 minutes of
inactivity. This also avoids an issue where there is an error when the user's
session has expired and they navigate a page
2017-11-01 16:43:22 +00:00
9e0fc8e6fd
Make the static segments work with match_any and fix bug in visit count
2017-10-24 10:50:05 +01:00
8c96fffd4e
Ensure that the session is checked correctly
2017-10-17 17:35:57 +01:00
675d219f1f
Add the logic for static segments
2017-10-17 16:57:07 +01:00
5fbfb82480
Switches back to absolute wagtail_personalisation imports.
2017-05-31 17:41:12 +02:00
f88722c827
Further simplifications.
2017-05-31 17:38:51 +02:00
4f2dc3a304
Handles both Python 2 & 3, and multiple optimisations & simplifications.
2017-05-31 17:13:33 +02:00
63d5de9803
Optimize query for the segment visits
2017-05-31 16:37:10 +02:00
7bb523d962
Minor codestyle issue in the adapters.refresh() code
2017-05-31 16:13:30 +02:00
03073eb004
Add unittests for the session adapter
2017-05-31 16:13:30 +02:00
e107d73716
Add docstring to set_segments()
2017-05-31 16:13:30 +02:00
cbc2ec7270
Simplify saving/retrieving user segments
2017-05-31 16:13:30 +02:00
f2aa8879a9
Add Adapter.set_segments() and use it when refreshig the segment
...
This makes the internal API a bit more consistent
2017-05-31 15:15:27 +02:00
9705947d3f
Use the Segment Adapter for retrieving page visits
...
This fixes the last occurence of directly accessing the session in the
codebase
2017-05-31 14:49:07 +02:00
31f8a329f2
Use constants for enabled/disabling status on Segment
2017-05-31 14:48:46 +02:00
fb95439d83
adapters docstring typo ( #120 )
2017-05-31 14:14:02 +02:00
dcb8867dc7
Merge pull request #108 from LabD/feature/segment-template-block
...
Adds an ifsegment template block
2017-05-31 14:02:08 +02:00
a78290281b
fixes adapter issues and fixes block for segments adapter
2017-05-31 13:58:31 +02:00
7436384471
Move visit count logic to the segment adapter
...
This makes the code also a bit simpler and updates the tests
2017-05-31 13:57:19 +02:00
cc38634519
Add adapters.get_segment_adapter to set the segment adapter on the request
...
object.
Previously the segment adapter was set globally with the request as
attribute. This causes thread safety issues. Instead we now initialise
the segment adapter for each request and set it as attribute
2017-05-31 13:33:22 +02:00
83a7db5952
Renames personalisation module in documentation
2017-05-30 15:46:27 +02:00
3eac2cd4dd
Codestyle fixes (flake8)
...
This also adds the flake8 dependencies to the test extras for
installation.
2017-05-28 09:13:08 +02:00
ebde527ae9
Renames the module from ‘personalisation’ to ‘wagtail_personalisation’
2017-05-26 16:31:54 +02:00