the-scouts / compass-interface-core

Core bridge/crawler component for Compass-Interface
5 stars 1 forks source link

TypeError when GDPR modules unvalidated #24

Closed rglss closed 3 years ago

rglss commented 3 years ago

https://github.com/the-scouts/compass-interface-core/blob/9d7eec0dc4bec76e6bdccfeacd852b034794c287/compass/core/_scrapers/member.py#L435

  File "/usr/local/lib/python3.9/site-packages/compass/core/_scrapers/member.py", line 435, in get_training_tab
  sorted(mod["validated_date"] for plp in training_plps.values() for mod in plp if mod["code"] == "GDPR")

  TypeError: '<' not supported between instances of 'NoneType' and 'NoneType'

Need to do a little more digging and locate the exact record, but think this condition occurs when the training is unvalidated and mod["validated_date"] is None.

AA-Turner commented 3 years ago

Couple of solutions to this - suprised it didn't come up in testing! Happens as parse() can return datetime.date or None, and None can't be sorted.

arbitrarypunter commented 3 years ago

Hi Adam Is there a plan to fix this in a future release? Thanks

AA-Turner commented 3 years ago

Fixed in 0.5.2!