From ebf8e1cd18652d10592529363f71f1d7d16dc395 Mon Sep 17 00:00:00 2001 From: Max Levine Date: Fri, 17 Jun 2022 16:51:09 +0100 Subject: [PATCH] Import Markup from MarkupSafe (#9) * Markup should be imported from MarkupSafe * Update Travis CI link * Version bump to 0.5.3 --- CHANGELOG | 6 +++++- README.md | 4 ++-- flask_xcaptcha.py | 11 +++++++---- setup.py | 1 + 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 922f02b..6ca6972 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +- 0.5.3 + - Markup should be imported from MarkupSafe + - 0.5.2 - Project URL updated - Use Travis CI for testing @@ -28,4 +31,5 @@ - Make use of requests - Version 0.1.0 - - First version \ No newline at end of file + - First version + diff --git a/README.md b/README.md index 9fb90c6..50e4777 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Flask-xCaptcha -[![Build Status](https://travis-ci.com/benjilev08/flask-xcaptcha.svg?branch=master)](https://travis-ci.com/benjilev08/flask-xcaptcha) +[![Build Status](https://app.travis-ci.com/bmaximuml/flask-xcaptcha.svg?branch=master)](https://app.travis-ci.com/bmaximuml/flask-xcaptcha) The new xCaptcha implementation for Flask without Flask-WTF. @@ -157,4 +157,4 @@ Returns a bool indicating whether or not the xCaptcha was successfully completed This will insert an HTML div element containing the captcha into a Jinja2 template -(c) 2020 Max Levine +(c) 2022 Max Levine diff --git a/flask_xcaptcha.py b/flask_xcaptcha.py index 8bbe56d..c9bd6ae 100644 --- a/flask_xcaptcha.py +++ b/flask_xcaptcha.py @@ -3,16 +3,19 @@ """ __NAME__ = "Flask-xCaptcha" -__version__ = "0.5.2" +__version__ = "0.5.3" __license__ = "MIT" __author__ = "Max Levine" -__copyright__ = "(c) 2020 Max Levine" +__copyright__ = "(c) 2022 Max Levine" try: from flask import request - from jinja2 import Markup + try: + from jinja2 import Markup + except ImportError: + from markupsafe import Markup import requests -except ImportError as ex: +except ImportError: print("Missing dependencies") diff --git a/setup.py b/setup.py index fd4b3c4..4c71d1c 100644 --- a/setup.py +++ b/setup.py @@ -24,6 +24,7 @@ install_requires=[ "flask", "requests" + "MarkupSafe" ], keywords=['flask', 'recaptcha', 'hcaptcha', 'xcaptcha', "validate"], platforms='any',