mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-08 22:17:34 +01:00
Add validation for modpack names with one mod
This commit is contained in:
parent
09eea443cf
commit
5c5608680b
@ -721,7 +721,11 @@ class Package(db.Model):
|
||||
if not (self.checkPerm(user, Permission.APPROVE_NEW) or self.checkPerm(user, Permission.EDIT_PACKAGE)):
|
||||
return False
|
||||
|
||||
if state == PackageState.APPROVED and ("Other" in self.license.name or "Other" in self.media_license.name):
|
||||
if state == PackageState.APPROVED and ("Other" in self.license.name or "Other" in self.media_license.name):
|
||||
return False
|
||||
|
||||
provides = self.provides
|
||||
if state == PackageState.APPROVED and len(provides) == 1 and provides[0].name != self.name:
|
||||
return False
|
||||
|
||||
if self.getMissingHardDependenciesQuery().count() > 0:
|
||||
|
@ -48,6 +48,10 @@
|
||||
{% elif package.state == package.state.READY_FOR_REVIEW and ("Other" in package.license.name or "Other" in package.media_license.name) %}
|
||||
{% set message = _("Please wait for the license to be added to CDB.") %}
|
||||
|
||||
{% elif package.state == package.state.READY_FOR_REVIEW and (package.provides | length) == 1 and package.provides[0].name != package.name %}
|
||||
{% set level = "danger" %}
|
||||
{% set message = _("Mod name does not match package name.") %}
|
||||
|
||||
{% else %}
|
||||
{% set level = "info" %}
|
||||
{% set message %}
|
||||
|
Loading…
Reference in New Issue
Block a user