palewire / django-calaccess-downloads-website

An open-source archive of campaign finance and lobbying disclosure data from the California Secretary of State’s CAL-ACCESS database
http://calaccess.californiacivicdata.org
MIT License
3 stars 4 forks source link

Something is wrong with createlatestlinks #172

Closed palewire closed 7 years ago

palewire commented 7 years ago

The latest download links are busted and here's what I get when I ssh into prod and try to run createlatestlinks by hand

(calaccess)ccdc@ip-172-31-29-254:/apps/calaccess/repo$ python manage.py createlatestlinks
/apps/calaccess/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py:1430: RuntimeWarning: DateTimeField RawDataVersion.release_datetime received a naive datetime (2016-07-27 00:00:00) while time zone support is active.
  RuntimeWarning)
DEBUG|12/Apr/2017 01:43:09|createlatestlinks|Copying files for 02-16-2017 22:50:55 version to latest/

That Feb. 16, 2017 date does not look good.

palewire commented 7 years ago

Something might be off with this:

>>> v = RawDataVersion.objects.latest('update_finish_datetime')
>>> v
<RawDataVersion: 2017-02-16 22:50:55+00:00>

Compared to the latest dates here:

>>> RawDataVersion.objects.all()
<QuerySet [<RawDataVersion: 2017-04-11 11:21:17+00:00>, <RawDataVersion: 2017-04-11 11:20:30+00:00>, <RawDataVersion: 2017-04-10 11:20:55+00:00>, <RawDataVersion: 2017-04-10 11:20:29+00:00>, <RawDataVersion: 2017-04-09 11:20:59+00:00>, <RawDataVersion: 2017-04-09 11:20:32+00:00>, <RawDataVersion: 2017-04-07 11:20:56+00:00>, <RawDataVersion: 2017-04-07 11:20:30+00:00>, <RawDataVersion: 2017-04-06 16:33:17+00:00>, <RawDataVersion: 2017-04-06 16:32:51+00:00>, <RawDataVersion: 2017-04-05 11:20:56+00:00>, <RawDataVersion: 2017-04-05 11:20:28+00:00>, <RawDataVersion: 2017-04-04 11:20:56+00:00>, <RawDataVersion: 2017-04-04 11:20:30+00:00>, <RawDataVersion: 2017-04-03 11:20:54+00:00>, <RawDataVersion: 2017-04-03 11:20:28+00:00>, <RawDataVersion: 2017-04-02 11:21:09+00:00>, <RawDataVersion: 2017-04-02 11:20:29+00:00>, <RawDataVersion: 2017-03-31 11:21:00+00:00>, <RawDataVersion: 2017-03-31 11:20:28+00:00>, '...(remaining elements truncated)...']
palewire commented 7 years ago

It looks to me like a null update_finish_datetime has sorted to the top:

>>> RawDataVersion.objects.all()[0].update_finish_datetime
datetime.datetime(2017, 4, 11, 13, 18, 22, 410878, tzinfo=<UTC>)
>>> v = RawDataVersion.objects.latest('update_finish_datetime').update_finish_datetime
>>>