diff options
author | rubenwardy <rw@rubenwardy.com> | 2020-01-18 01:38:00 +0000 |
---|---|---|
committer | rubenwardy <rw@rubenwardy.com> | 2020-01-18 01:38:00 +0000 |
commit | 077bdeb01c5725344d871705f2bd97df4ff96bef (patch) | |
tree | a86491032501d23c3ac1a6bafa54730357a158ff /app | |
parent | 095494f96f00b33dc9e956b094105c49b5bc558b (diff) | |
download | cheatdb-077bdeb01c5725344d871705f2bd97df4ff96bef.tar.xz |
Add reloading support to Docker container
Diffstat (limited to 'app')
-rw-r--r-- | app/blueprints/thumbnails/__init__.py | 2 | ||||
-rw-r--r-- | app/models.py | 2 | ||||
-rw-r--r-- | app/tasks/phpbbparser.py | 2 | ||||
-rw-r--r-- | app/utils.py | 4 |
4 files changed, 5 insertions, 5 deletions
diff --git a/app/blueprints/thumbnails/__init__.py b/app/blueprints/thumbnails/__init__.py index 820d228..109cc0c 100644 --- a/app/blueprints/thumbnails/__init__.py +++ b/app/blueprints/thumbnails/__init__.py @@ -25,7 +25,7 @@ from PIL import Image ALLOWED_RESOLUTIONS=[(100,67), (270,180), (350,233)] def mkdir(path): - assert(path != "" and path is not None) + assert path != "" and path is not None if not os.path.isdir(path): os.mkdir(path) diff --git a/app/models.py b/app/models.py index 736a0dc..34b689c 100644 --- a/app/models.py +++ b/app/models.py @@ -752,7 +752,7 @@ class PackageRelease(db.Model): not self.package.checkPerm(user, Permission.APPROVE_RELEASE): return False - assert(self.task_id is None and self.url is not None and self.url != "") + assert self.task_id is None and self.url is not None and self.url != "" self.approved = True return True diff --git a/app/tasks/phpbbparser.py b/app/tasks/phpbbparser.py index d3e1231..3df8470 100644 --- a/app/tasks/phpbbparser.py +++ b/app/tasks/phpbbparser.py @@ -121,7 +121,7 @@ def parseForumListPage(id, page, out, extra=None): if id in out: print(" - got {} again, title: {}".format(id, title)) - assert(title == out[id]['title']) + assert title == out[id]['title'] return False row = { diff --git a/app/utils.py b/app/utils.py index 5d1c8da..983111c 100644 --- a/app/utils.py +++ b/app/utils.py @@ -46,13 +46,13 @@ def randomString(n): return ''.join(random.choice(string.ascii_lowercase + \ string.ascii_uppercase + string.digits) for _ in range(n)) -assert(os.path.isdir(app.config["UPLOAD_DIR"]), "UPLOAD_DIR must exist") - def doFileUpload(file, fileType, fileTypeDesc): if not file or file is None or file.filename == "": flash("No selected file", "error") return None + assert os.path.isdir(app.config["UPLOAD_DIR"]), "UPLOAD_DIR must exist" + allowedExtensions = [] isImage = False if fileType == "image": |