worthwhile / django-herald

A Django messaging library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

confusing 'delnotifs' command with optional start and end args

pzmosquito opened this issue · comments

for delnotifs command with start and end args, doc says:

end is up to, but not including that date.

I'd think if I specify the end date being yesterday without start date, it will delete notifications sent before yesterday.

the actual code is

start_date = options['start'] if options['start'] else today

This will set the start date to be today, and end date to be yesterday, it's going to be an invalid range.

Suggestion:

  • if only end date is specified, delete anything sent before date_sent
  • if only start date is specified, delete anything sent after date_sent
  • if both start and end dates are specified, delete the range

@pzmosquito PRs are welcome.

PR #72 submitted

PR merged