ignoring warnings of too complex function

This commit is contained in:
Cayo Puigdefabregas 2022-03-02 13:31:21 +01:00
parent c52480231b
commit e45a4982c6
1 changed files with 3 additions and 3 deletions

View File

@ -180,7 +180,7 @@ class UploadSnapshotForm(FlaskForm):
db.session.commit() db.session.commit()
return response return response
def build(self, snapshot_json): def build(self, snapshot_json): # noqa: C901
# this is a copy adaptated from ereuse_devicehub.resources.action.views.snapshot # this is a copy adaptated from ereuse_devicehub.resources.action.views.snapshot
device = snapshot_json.pop('device') # type: Computer device = snapshot_json.pop('device') # type: Computer
components = None components = None
@ -294,7 +294,7 @@ class NewDeviceForm(FlaskForm):
if not self.depth.data: if not self.depth.data:
self.depth.data = 0.1 self.depth.data = 0.1
def validate(self, extra_validators=None): def validate(self, extra_validators=None): # noqa: C901
error = ["Not a correct value"] error = ["Not a correct value"]
is_valid = super().validate(extra_validators) is_valid = super().validate(extra_validators)
@ -489,7 +489,7 @@ class TagDeviceForm(FlaskForm):
if self.device.data: if self.device.data:
try: try:
self.device.data = int(self.device.data.split(',')[-1]) self.device.data = int(self.device.data.split(',')[-1])
except: except: # noqa: E722
self.device.data = None self.device.data = None
if self.device_id or self.device.data: if self.device_id or self.device.data: