]> git.lizzy.rs Git - cheatdb.git/commitdiff
Fix scores not degrading due to missing session.commit() v1.23.9
authorrubenwardy <rw@rubenwardy.com>
Sun, 22 Mar 2020 19:46:46 +0000 (19:46 +0000)
committerrubenwardy <rw@rubenwardy.com>
Sun, 22 Mar 2020 19:47:52 +0000 (19:47 +0000)
app/tasks/pkgtasks.py

index d36803cf43961fb279196aa0c66d09b9eb641c20..c864ad0470a7a5f84481451a3225384f395069c7 100644 (file)
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 
-from app.models import Package
+from app.models import Package, db
 from app.tasks import celery
 
 @celery.task()
 def updatePackageScores():
-       Package.query.update({ "score": Package.score * 0.8 })
+       Package.query.update({ "score": Package.score * 0.95 })
+       db.session.commit()