- if digest_control is None:
- digest_control = KeyValue(key='DIGEST_CONTROL', value={
- 'LAST_DAILY': datetime.now() - timedelta(days=1),
- 'LAST_WEEKLY': datetime.now() - timedelta(days=1),
- })
-
- self.send_digest('daily', 'd', digest_control.value['LAST_DAILY'])
- digest_control.value['LAST_DAILY'] = datetime.now()
-
- if digest_control.value['LAST_WEEKLY'] + timedelta(days=7) <= datetime.now():
- self.send_digest('weekly', 'w', digest_control.value['LAST_WEEKLY'])
- digest_control.value['LAST_WEEKLY'] = datetime.now()
+ def get_for_user(self, user):
+ user_tags = list(user.marked_tags.filter(user_selections__reason='good'))