mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-08 22:17:34 +01:00
Remove updateFromRelease feature
This commit is contained in:
parent
f5aee035b3
commit
545968a71f
@ -505,34 +505,6 @@ def remove_self_maintainers(package):
|
||||
return redirect(package.getDetailsURL())
|
||||
|
||||
|
||||
@bp.route("/packages/<author>/<name>/import-meta/", methods=["POST"])
|
||||
@login_required
|
||||
@is_package_page
|
||||
def update_from_release(package):
|
||||
if not package.checkPerm(current_user, Permission.REIMPORT_META):
|
||||
flash("You don't have permission to reimport meta", "danger")
|
||||
return redirect(package.getDetailsURL())
|
||||
|
||||
release = package.releases.first()
|
||||
if not release:
|
||||
flash("Release needed", "danger")
|
||||
return redirect(package.getDetailsURL())
|
||||
|
||||
msg = "Updated meta from latest release"
|
||||
addNotification(package.maintainers, current_user, NotificationType.PACKAGE_EDIT,
|
||||
msg, package.getDetailsURL(), package)
|
||||
severity = AuditSeverity.NORMAL if current_user in package.maintainers else AuditSeverity.EDITOR
|
||||
addAuditLog(severity, current_user, msg, package.getDetailsURL(), package)
|
||||
|
||||
db.session.commit()
|
||||
|
||||
task_id = uuid()
|
||||
zippath = release.url.replace("/uploads/", app.config["UPLOAD_DIR"])
|
||||
checkZipRelease.apply_async((release.id, zippath), task_id=task_id)
|
||||
|
||||
return redirect(url_for("tasks.check", id=task_id, r=package.getEditURL()))
|
||||
|
||||
|
||||
@bp.route("/packages/<author>/<name>/audit/")
|
||||
@login_required
|
||||
@is_package_page
|
||||
|
@ -535,10 +535,6 @@ class Package(db.Model):
|
||||
return url_for("packages.remove_self_maintainers",
|
||||
author=self.author.username, name=self.name)
|
||||
|
||||
def getUpdateFromReleaseURL(self):
|
||||
return url_for("packages.update_from_release",
|
||||
author=self.author.username, name=self.name)
|
||||
|
||||
def getReviewURL(self):
|
||||
return url_for('packages.review',
|
||||
author=self.author.username, name=self.name)
|
||||
@ -607,9 +603,6 @@ class Package(db.Model):
|
||||
elif perm == Permission.CHANGE_RELEASE_URL:
|
||||
return user.rank.atLeast(UserRank.MODERATOR)
|
||||
|
||||
elif perm == Permission.REIMPORT_META:
|
||||
return user.rank.atLeast(UserRank.ADMIN)
|
||||
|
||||
else:
|
||||
raise Exception("Permission {} is not related to packages".format(perm.name))
|
||||
|
||||
|
@ -66,7 +66,6 @@ class Permission(enum.Enum):
|
||||
MAKE_RELEASE = "MAKE_RELEASE"
|
||||
DELETE_RELEASE = "DELETE_RELEASE"
|
||||
ADD_SCREENSHOTS = "ADD_SCREENSHOTS"
|
||||
REIMPORT_META = "REIMPORT_META"
|
||||
APPROVE_SCREENSHOT = "APPROVE_SCREENSHOT"
|
||||
APPROVE_RELEASE = "APPROVE_RELEASE"
|
||||
APPROVE_NEW = "APPROVE_NEW"
|
||||
|
@ -50,17 +50,6 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if package and package.checkPerm(current_user, "REIMPORT_META") and package.releases.first() %}
|
||||
<form class="alert alert-secondary mb-5" method="post" action="{{ package.getUpdateFromReleaseURL() }}">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
||||
<input class="btn btn-sm btn-warning float-right" type="submit" value="{{ _('Import') }}" />
|
||||
|
||||
<b>{{ _("Reimport meta from latest release.") }}</b>
|
||||
{{ _("This will override 'provides', 'dependencies', and 'optional_dependencies'.") }}
|
||||
<div style="clear:both;"></div>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
<noscript>
|
||||
<div class="alert alert-warning">
|
||||
{{ _("Javascript is needed to improve the user interface, and is needed for features
|
||||
|
Loading…
Reference in New Issue
Block a user