|
@@ -297,13 +297,13 @@ class ServiceWorker(Endpoint):
|
|
def route(self, *args, **kwargs):
|
|
def route(self, *args, **kwargs):
|
|
return flask.send_file("../js/serviceWorker.js", mimetype="text/javascript")
|
|
return flask.send_file("../js/serviceWorker.js", mimetype="text/javascript")
|
|
|
|
|
|
|
|
+
|
|
@endpoint("/add-link")
|
|
@endpoint("/add-link")
|
|
class AddLink(Endpoint):
|
|
class AddLink(Endpoint):
|
|
def html(self):
|
|
def html(self):
|
|
if not self.user:
|
|
if not self.user:
|
|
raise e.LCRedirect("/login")
|
|
raise e.LCRedirect("/login")
|
|
|
|
|
|
-
|
|
|
|
args = flask.request.args.copy()
|
|
args = flask.request.args.copy()
|
|
|
|
|
|
# Android sets the text field to the url only
|
|
# Android sets the text field to the url only
|
|
@@ -311,7 +311,7 @@ class AddLink(Endpoint):
|
|
text = args.get("text", "")
|
|
text = args.get("text", "")
|
|
if url is None and text.startswith("http"):
|
|
if url is None and text.startswith("http"):
|
|
args["url"] = text
|
|
args["url"] = text
|
|
- del args['text']
|
|
|
|
|
|
+ del args["text"]
|
|
|
|
|
|
args = "&".join(f"{key}={value}" for key, value in args.items())
|
|
args = "&".join(f"{key}={value}" for key, value in args.items())
|
|
|
|
|