Add create links to topic table

This commit is contained in:
rubenwardy
2018-06-05 23:45:15 +01:00
parent 8601c5e075
commit c9542427b4
6 changed files with 64 additions and 60 deletions

View File

@@ -659,6 +659,10 @@ class EditRequestChange(db.Model):
setattr(package, self.key.name, self.newValue)
REPO_BLACKLIST = [".zip", "mediafire.com", "dropbox.com", "weebly.com", \
"minetest.net", "dropboxusercontent.com", "4shared.com", \
"digitalaudioconcepts.com", "hg.intevation.org", "www.wtfpl.net", \
"imageshack.com", "imgur.com"]
class KrockForumTopic(db.Model):
topic_id = db.Column(db.Integer, primary_key=True, autoincrement=False)
@@ -676,6 +680,13 @@ class KrockForumTopic(db.Model):
elif self.ttype == 6:
return PackageType.GAME
def getRepoURL(self):
for item in REPO_BLACKLIST:
if item in self.link:
return None
return self.link.replace("repo.or.cz/w/", "repo.or.cz/")
# Setup Flask-User
db_adapter = SQLAlchemyAdapter(db, User) # Register the User model