diff --git a/.flake8 b/.flake8 index 92280ec7..b3800cd4 100644 --- a/.flake8 +++ b/.flake8 @@ -1,3 +1,3 @@ [flake8] max-line-length = 300 -ignore = E731, E241, W503, E741 +ignore = E731, E241, E741 diff --git a/main/models.py b/main/models.py index dfedd320..1ca8e18f 100644 --- a/main/models.py +++ b/main/models.py @@ -280,8 +280,7 @@ def grouper(depend): dep_pkgs = list(dep_pkgs) dep = dep_pkgs[0] if len(dep_pkgs) > 1: - dep_pkgs = [d for d in dep_pkgs if d.pkg.repo.testing == self.repo.testing - and d.pkg.repo.staging == self.repo.staging] + dep_pkgs = [d for d in dep_pkgs if d.pkg.repo.testing == self.repo.testing and d.pkg.repo.staging == self.repo.staging] if len(dep_pkgs) > 0: dep = dep_pkgs[0] trimmed.append(dep) diff --git a/packages/models.py b/packages/models.py index 789c3bda..6e53c8ca 100644 --- a/packages/models.py +++ b/packages/models.py @@ -253,9 +253,7 @@ def log_update(self, old_pkg, new_pkg): if new_pkg: update.action_flag = CHANGE # ensure we should even be logging this - if (old_pkg.pkgver == new_pkg.pkgver - and old_pkg.pkgrel == new_pkg.pkgrel - and old_pkg.epoch == new_pkg.epoch): + if old_pkg.pkgver == new_pkg.pkgver and old_pkg.pkgrel == new_pkg.pkgrel and old_pkg.epoch == new_pkg.epoch: # all relevant fields were the same; e.g. a force update return else: @@ -397,8 +395,7 @@ def get_best_satisfier(self): # actually satisfy the requirements if self.comparison and self.version: alpm = AlpmAPI() - pkgs = [pkg for pkg in pkgs if not alpm.available - or alpm.compare_versions(pkg.full_version, self.comparison, self.version)] + pkgs = [pkg for pkg in pkgs if not alpm.available or alpm.compare_versions(pkg.full_version, self.comparison, self.version)] if len(pkgs) == 0: # couldn't find a package in the DB # it should be a virtual depend (or a removed package) diff --git a/packages/views/flag.py b/packages/views/flag.py index b8a60543..987b295b 100644 --- a/packages/views/flag.py +++ b/packages/views/flag.py @@ -37,11 +37,7 @@ def clean_message(self): # make sure the message isn't garbage (only punctuation or whitespace) # or spam (using a simple denylist) # and ensure a certain minimum length - if ( - re.match(r'^[^0-9A-Za-z]+$', data) - or any(fd.keyword in data for fd in FlagDenylist.objects.all()) - or len(data) < 3 - ): + if re.match(r'^[^0-9A-Za-z]+$', data) or any(fd.keyword in data for fd in FlagDenylist.objects.all()) or len(data) < 3: raise forms.ValidationError("Enter a valid and useful out-of-date message.") return data