when linting db code I unintentionally swapped the return of mode_data with mode_label, causing NaN in stats.js when trying to calculate the mode doughnut.
Reverts this bug. Fixes#325
Signed-off-by: Corey Shields <cshields@gmail.com>
This change affects existing development environments which will have
to be recreated with the Python 3 interpreter as the default.
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
Fixes the cyclical dependency between celery.py and tasks.py when update_all_tle is called outside of celery by switching to autodiscovered tasks
Signed-off-by: Corey Shields <cshields@gmail.com>
[acinonyx@openwrt.gr: use @shared_task decorator and wrapper tasks to workaround celery bug]
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
Fix some spacing issues and import syntax introduced by my linting changes.
The inline pylint disable for C0412 clashes with isort, there is no combination there that works for both.
Signed-off-by: Corey Shields <cshields@gmail.com>
Fixing these as part of W0511
There were some transmitter properties labeled "has_" (which implies a boolean) while returning a count. Renamed them and their instances to "_count" along with cleaning up some variables
Signed-off-by: Corey Shields <cshields@gmail.com>
There are clashes between the positioning and ordering of our imports between pylint and isort, just ignoring them on the pylint side for now..
Signed-off-by: Corey Shields <cshields@gmail.com>
Fixes a cyclical dependency between calling the celery app through an import in tasks.py (which then imports tasks.py) by retrieving celery through the class.
Tested in local dev
Signed-off-by: Corey Shields <cshields@gmail.com>
R0801 trips on our norad argument handling in fetch_satellites.py and delete_satellite.py - but there is no way to disable it locally due to a bug. See https://github.com/PyCQA/pylint/issues/214
Signed-off-by: Corey Shields <cshields@gmail.com>
Ignoring cases of too many ancestors in API views.py as these are upstream, not much we can do about it.
Signed-off-by: Corey Shields <cshields@gmail.com>
Ignoring R0903 for tests.py where we do not need to care about public methods, and for django managers in models.py
This negates the need for MR !396
Signed-off-by: Corey Shields <cshields@gmail.com>
A couple of functions in tasks and utils were refactored with new helper functions to reduce the number of local variables per function.
In addition, fetch_data.py was flagged with R0914 but this is a relic of the original attempt at decoding data into DB, and is unused - so I am removing rather than fixing it.
Signed-off-by: Corey Shields <cshields@gmail.com>
Signed-off-by: Corey Shields <cshields@gmail.com>
Fix some spacing issues brought up in a full tox run (that were not identified in my prior linting flows)
too-many-nested-blocks - pulled a break point out for utils.py/decode_data to get rid of a nested block
Signed-off-by: Corey Shields <cshields@gmail.com>
broad-except, I added explicit exceptions where I felt safe doing so - but we do have a lot of broad exceptions accepted.
Signed-off-by: Corey Shields <cshields@gmail.com>
Linting W0613 led to the discovery that we filter on status entries that do not exist. Changing "functional" to "active" will fix https://db.satnogs.org/api/transmitters/?alive=true
fixes satnogs-db#298
Signed-off-by: Corey Shields <cshields@gmail.com>
We were missing a call to return the login page from a BaseAuth abstract function.
Once this is in dev (an auth0 environment) I suspect it might fix librespacefoundation/satnogs/satnogs-db#309
Signed-off-by: Corey Shields <cshields@gmail.com>
we are going to ignore W0201 and W0221 around the TransmitterEntry save function. Reasons are in the code comments.
Signed-off-by: Corey Shields <cshields@gmail.com>
the check_celery function returns in a finally, which is unnecessary and is an antipattern. This works just the same dropping the finally statement and returning in the end.
Signed-off-by: Corey Shields <cshields@gmail.com>
display_decoded is an unused relic of the original decode method, and throws a W0105 warning.
removing this function completely
Signed-off-by: Corey Shields <cshields@gmail.com>
cleaning up C0111 exposed that we have some helpers initially added when django cache was implemented, but have since been abandoned.
Removing them as they are unused and unneeded
Signed-off-by: Corey Shields <cshields@gmail.com>