mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-22 22:12:24 +01:00
Fix erroneous updates from Git Update Detector
This commit is contained in:
parent
70f491fd27
commit
d7647520c8
@ -274,10 +274,15 @@ def set_update_config(package, form):
|
||||
package.update_config.ref = nonEmptyOrNone(form.ref.data)
|
||||
package.update_config.make_release = form.action.data == "make_release"
|
||||
|
||||
if package.update_config.last_commit is None:
|
||||
last_release = package.releases.first()
|
||||
if last_release and last_release.commit_hash:
|
||||
package.update_config.last_commit = last_release.commit_hash
|
||||
if package.update_config.trigger == PackageUpdateTrigger.COMMIT:
|
||||
if package.update_config.last_commit is None:
|
||||
last_release = package.releases.first()
|
||||
if last_release and last_release.commit_hash:
|
||||
package.update_config.last_commit = last_release.commit_hash
|
||||
elif package.update_config.trigger == PackageUpdateTrigger.TAG:
|
||||
# Only create releases for tags created after this
|
||||
package.update_config.last_commit = None
|
||||
package.update_config.last_tag = None
|
||||
|
||||
package.update_config.outdated_at = None
|
||||
package.update_config.auto_created = False
|
||||
|
@ -214,7 +214,7 @@ def apply_all_updates(username):
|
||||
makeVCSRelease.apply_async((rel.id, ref),
|
||||
task_id=rel.task_id)
|
||||
|
||||
msg = "Created release {} (Applied all Git Update Config)".format(rel.title)
|
||||
msg = "Created release {} (Applied all Git Update Detection)".format(rel.title)
|
||||
addNotification(package.maintainers, current_user, NotificationType.PACKAGE_EDIT, msg,
|
||||
rel.getEditURL(), package)
|
||||
addAuditLog(AuditSeverity.NORMAL, current_user, msg, package.getDetailsURL(), package)
|
||||
|
@ -327,6 +327,9 @@ def check_update_config_impl(package):
|
||||
else:
|
||||
raise TaskError("Unknown update trigger")
|
||||
|
||||
if commit is None:
|
||||
return
|
||||
|
||||
if config.last_commit == commit:
|
||||
if tag and config.last_tag != tag:
|
||||
config.last_tag = tag
|
||||
|
Loading…
Reference in New Issue
Block a user