diff --git a/app/blueprints/admin/actions.py b/app/blueprints/admin/actions.py index b0821838..466053d6 100644 --- a/app/blueprints/admin/actions.py +++ b/app/blueprints/admin/actions.py @@ -107,7 +107,7 @@ def import_screenshots(): packages = Package.query \ .filter(Package.state != PackageState.DELETED) \ .outerjoin(PackageScreenshot, Package.id == PackageScreenshot.package_id) \ - .filter(PackageScreenshot.id.is_(None)) \ + .filter(PackageScreenshot.id==None) \ .all() for package in packages: importRepoScreenshot.delay(package.id) @@ -293,12 +293,12 @@ def delete_inactive_users(): @action("Send Video URL notification") def remind_video_url(): users = User.query.filter(User.maintained_packages.any( - and_(Package.video_url.is_(None), Package.type==PackageType.GAME, Package.state==PackageState.APPROVED))) + and_(Package.video_url==None, Package.type==PackageType.GAME, Package.state==PackageState.APPROVED))) system_user = get_system_user() for user in users: packages = db.session.query(Package.title).filter( or_(Package.author==user, Package.maintainers.any(User.id==user.id)), - Package.video_url.is_(None), + Package.video_url==None, Package.type == PackageType.GAME, Package.state == PackageState.APPROVED) \ .all() diff --git a/app/blueprints/github/__init__.py b/app/blueprints/github/__init__.py index 44c4ec1d..85ac39c7 100644 --- a/app/blueprints/github/__init__.py +++ b/app/blueprints/github/__init__.py @@ -96,7 +96,7 @@ def webhook(): # Get all tokens for package tokens_query = APIToken.query.filter(or_(APIToken.package==package, - and_(APIToken.package.is_(None), APIToken.owner==package.author))) + and_(APIToken.package==None, APIToken.owner==package.author))) possible_tokens = tokens_query.all() actual_token = None diff --git a/app/blueprints/todo/__init__.py b/app/blueprints/todo/__init__.py index a0e881c0..960c4932 100644 --- a/app/blueprints/todo/__init__.py +++ b/app/blueprints/todo/__init__.py @@ -307,7 +307,7 @@ def mtver_support(): current_stable = MinetestRelease.query.filter(~MinetestRelease.name.like("%-dev")).order_by(db.desc(MinetestRelease.id)).first() query = db.session.query(Package) \ - .filter(~Package.releases.any(or_(PackageRelease.max_rel.is_(None), PackageRelease.max_rel == current_stable))) \ + .filter(~Package.releases.any(or_(PackageRelease.max_rel==None, PackageRelease.max_rel == current_stable))) \ .filter(Package.state == PackageState.APPROVED) if is_mtm_only: diff --git a/app/logic/package_validator.py b/app/logic/package_validator.py index b0738c59..66965e6c 100644 --- a/app/logic/package_validator.py +++ b/app/logic/package_validator.py @@ -19,7 +19,7 @@ def validate_package_for_approval(package: Package) -> List[ValidationError]: Package.name == normalised_name + "_game"))).count() > 0: retval.append(("danger", lazy_gettext("A package already exists with this name. Please see Policy and Guidance 3"))) - if package.releases.filter(PackageRelease.task_id.is_(None)).count() == 0: + if package.releases.filter(PackageRelease.task_id==None).count() == 0: retval.append(("danger", lazy_gettext("A release is required before this package can be approved."))) # Don't bother validating any more until we have a release return retval diff --git a/app/models/packages.py b/app/models/packages.py index 8cb79049..56194782 100644 --- a/app/models/packages.py +++ b/app/models/packages.py @@ -748,7 +748,7 @@ class Package(db.Model): (self.type == self.type.GAME or self.type == self.type.TXP) and \ self.screenshots.count() == 0 - return self.releases.filter(PackageRelease.task_id.is_(None)).count() > 0 and not needsScreenshot + return self.releases.filter(PackageRelease.task_id==None).count() > 0 and not needsScreenshot elif state == PackageState.CHANGES_NEEDED: return self.checkPerm(user, Permission.APPROVE_NEW) diff --git a/app/querybuilder.py b/app/querybuilder.py index f8c693bb..294272f3 100644 --- a/app/querybuilder.py +++ b/app/querybuilder.py @@ -109,9 +109,9 @@ class QueryBuilder: if self.version: releases_query = releases_query \ - .filter(or_(PackageRelease.min_rel_id.is_(None), + .filter(or_(PackageRelease.min_rel_id==None, PackageRelease.min_rel_id <= self.version.id)) \ - .filter(or_(PackageRelease.max_rel_id.is_(None), + .filter(or_(PackageRelease.max_rel_id==None, PackageRelease.max_rel_id >= self.version.id)) return releases_query.all() @@ -173,16 +173,16 @@ class QueryBuilder: query = query.filter(Package.media_license.has(License.is_foss == True)) if self.hide_wip: - query = query.filter(or_(Package.dev_state.is_(None), Package.dev_state != PackageDevState.WIP)) + query = query.filter(or_(Package.dev_state==None, Package.dev_state != PackageDevState.WIP)) if self.hide_deprecated: - query = query.filter(or_(Package.dev_state.is_(None), Package.dev_state != PackageDevState.DEPRECATED)) + query = query.filter(or_(Package.dev_state==None, Package.dev_state != PackageDevState.DEPRECATED)) if self.version: query = query.join(Package.releases) \ .filter(PackageRelease.approved == True) \ - .filter(or_(PackageRelease.min_rel_id.is_(None), + .filter(or_(PackageRelease.min_rel_id==None, PackageRelease.min_rel_id <= self.version.id)) \ - .filter(or_(PackageRelease.max_rel_id.is_(None), + .filter(or_(PackageRelease.max_rel_id==None, PackageRelease.max_rel_id >= self.version.id)) return query