Check type and author in package details

This commit is contained in:
rubenwardy
2018-03-20 00:58:44 +00:00
parent bc88027fbe
commit 07a9b79396
2 changed files with 17 additions and 1 deletions

View File

@@ -71,6 +71,17 @@ class PackageType(enum.Enum):
else:
return "TXP"
@staticmethod
def fromName(name):
if name == "mod":
return PackageType.MOD
elif name == "game":
return PackageType.GAME
elif name == "texturepacks":
return PackageType.TXP
else:
return None
class Package(db.Model):
id = db.Column(db.Integer, primary_key=True)