1
0
Fork 0

{api/views.py|base/models.py}: Disable false-positive no-member pylint errors (E1101)

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
merge-requests/874/head 1.24
Fabian P. Schmidt 2020-01-02 22:47:43 +01:00
parent ec73abeaa7
commit a6de5b44f9
3 changed files with 7 additions and 3 deletions

View File

@ -5,7 +5,6 @@ ignored-argument-names=args|kwargs
[MESSAGES CONTROL]
disable=
E1101, # no-member
E1121, # too-many-function-args
R0801, # needs to remain disabled see https://github.com/PyCQA/pylint/issues/214
R0912, # too-many-branches

View File

@ -86,7 +86,9 @@ class ObservationView( # pylint: disable=R0901
data='Audio has already been uploaded', status=status.HTTP_403_FORBIDDEN
)
super(ObservationView, self).update(request, *args, **kwargs)
# False-positive no-member (E1101) pylint error:
# Parent class rest_framework.mixins.UpdateModelMixin provides the 'update' method
super(ObservationView, self).update(request, *args, **kwargs) # pylint: disable=E1101
return Response(status=status.HTTP_200_OK)

View File

@ -259,7 +259,10 @@ class Station(models.Model):
@property
def observations_future_count(self):
"""Return the number of future station's observations"""
count = self.observations.is_future().count()
# False-positive no-member (E1101) pylint error:
# Instance of 'Station' has 'observations' member due to the
# Observation.station ForeignKey related_name
count = self.observations.is_future().count() # pylint: disable=E1101
return count
@property