Linting for E1101
Pylint throws 2 false positives for E1101 under Python2 (but runs cleanly in Python3). Disabling these. Signed-off-by: Corey Shields <cshields@gmail.com>merge-requests/402/head
parent
f9336eb0b4
commit
9359532df9
|
@ -6,6 +6,5 @@ ignored-argument-names=args|kwargs
|
||||||
[MESSAGES CONTROL]
|
[MESSAGES CONTROL]
|
||||||
disable=
|
disable=
|
||||||
C0412,
|
C0412,
|
||||||
E1101,
|
|
||||||
R0801, # needs to remain disabled see https://github.com/PyCQA/pylint/issues/214
|
R0801, # needs to remain disabled see https://github.com/PyCQA/pylint/issues/214
|
||||||
W0511,
|
W0511,
|
||||||
|
|
|
@ -114,7 +114,8 @@ class Satellite(models.Model):
|
||||||
|
|
||||||
:returns: the valid transmitters for this Satellite
|
:returns: the valid transmitters for this Satellite
|
||||||
"""
|
"""
|
||||||
return Transmitter.objects.filter(satellite=self.id).exclude(status='invalid')
|
# Remove the following pylint disable after Python 3 migration
|
||||||
|
return Transmitter.objects.filter(satellite=self.id).exclude(status='invalid') # pylint: disable=E1101
|
||||||
|
|
||||||
# TODO: rename this to sound more like a count
|
# TODO: rename this to sound more like a count
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -61,7 +61,8 @@ def calculate_transmitters_stats():
|
||||||
transmitters in db (such as total and percentage of alive)"""
|
transmitters in db (such as total and percentage of alive)"""
|
||||||
transmitters = Transmitter.objects.all()
|
transmitters = Transmitter.objects.all()
|
||||||
total_transmitters = transmitters.count()
|
total_transmitters = transmitters.count()
|
||||||
alive_transmitters = transmitters.filter(status='active').count()
|
# Remove the following pylint disable after Python 3 migration
|
||||||
|
alive_transmitters = transmitters.filter(status='active').count() # pylint: disable=E1101
|
||||||
if alive_transmitters > 0 and total_transmitters > 0:
|
if alive_transmitters > 0 and total_transmitters > 0:
|
||||||
try:
|
try:
|
||||||
alive_transmitters_percentage = '{0}%'.format(
|
alive_transmitters_percentage = '{0}%'.format(
|
||||||
|
|
Loading…
Reference in New Issue