mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-24 15:01:35 +01:00
Add audit logging for game support pages
This commit is contained in:
parent
e6f36113ce
commit
324d7ec1e1
@ -706,6 +706,8 @@ def game_support(package):
|
|||||||
|
|
||||||
package.supports_all_games = form.supports_all_games.data
|
package.supports_all_games = form.supports_all_games.data
|
||||||
|
|
||||||
|
addAuditLog(AuditSeverity.NORMAL, current_user, "Edited game support", package.getURL("packages.game_support"), package)
|
||||||
|
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
if detect_update_needed:
|
if detect_update_needed:
|
||||||
|
@ -162,11 +162,17 @@ def confirm_supports_all_games(username=None):
|
|||||||
if current_user != user and not current_user.rank.atLeast(UserRank.EDITOR):
|
if current_user != user and not current_user.rank.atLeast(UserRank.EDITOR):
|
||||||
abort(403)
|
abort(403)
|
||||||
|
|
||||||
db.session.query(Package).filter(
|
packages = user.maintained_packages.filter(
|
||||||
Package.maintainers.contains(user),
|
|
||||||
Package.state != PackageState.DELETED,
|
Package.state != PackageState.DELETED,
|
||||||
Package.type.in_([PackageType.MOD, PackageType.TXP]),
|
Package.type.in_([PackageType.MOD, PackageType.TXP])) \
|
||||||
~Package.supported_games.any(supports=True)).update({ "supports_all_games": True })
|
.order_by(db.asc(Package.title)).all()
|
||||||
|
|
||||||
|
for package in packages:
|
||||||
|
package.supports_all_games = True
|
||||||
|
db.session.merge(package)
|
||||||
|
|
||||||
|
addAuditLog(AuditSeverity.NORMAL, current_user, "Enabled 'Supports all games' (bulk)",
|
||||||
|
package.getURL("packages.game_support"), package)
|
||||||
|
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user