From 5a3b79b4cf61516c271c3695db6ae4e85d995fcf Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Thu, 31 Dec 2020 14:25:44 +0100 Subject: [PATCH] replace available_suffixes by available_suffixes_more_info --- app/api/views/alias_options.py | 15 ++++++++------- app/oauth/templates/oauth/authorize.html | 8 ++++---- app/oauth/views/authorize.py | 5 ++--- tests/dashboard/test_custom_alias.py | 20 ++++++++++---------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/app/api/views/alias_options.py b/app/api/views/alias_options.py index d17bee24..f6ad5301 100644 --- a/app/api/views/alias_options.py +++ b/app/api/views/alias_options.py @@ -3,7 +3,9 @@ from sqlalchemy import desc from app.api.base import api_bp, require_api_auth from app.config import ALIAS_DOMAINS, DISABLE_ALIAS_SUFFIX -from app.dashboard.views.custom_alias import available_suffixes +from app.dashboard.views.custom_alias import ( + available_suffixes_more_info, +) from app.extensions import db from app.log import LOG from app.models import AliasUsedOn, Alias, User @@ -299,11 +301,10 @@ def options_v4(): domain_name = convert_to_id(domain_name) ret["prefix_suggestion"] = domain_name - # List of (is_custom_domain, alias-suffix, time-signed alias-suffix) - suffixes = available_suffixes(user) + suffixes = available_suffixes_more_info(user) # custom domain should be put first - ret["suffixes"] = list([suffix[1], suffix[2]] for suffix in suffixes) + ret["suffixes"] = list([suffix.suffix, suffix.signed_suffix] for suffix in suffixes) return jsonify(ret) @@ -371,12 +372,12 @@ def options_v5(): domain_name = convert_to_id(domain_name) ret["prefix_suggestion"] = domain_name - # List of (is_custom_domain, alias-suffix, time-signed alias-suffix) - suffixes = available_suffixes(user) + suffixes = available_suffixes_more_info(user) # custom domain should be put first ret["suffixes"] = [ - {"suffix": suffix[1], "signed_suffix": suffix[2]} for suffix in suffixes + {"suffix": suffix.suffix, "signed_suffix": suffix.signed_suffix} + for suffix in suffixes ] return jsonify(ret) diff --git a/app/oauth/templates/oauth/authorize.html b/app/oauth/templates/oauth/authorize.html index 26924fea..f62e2d06 100644 --- a/app/oauth/templates/oauth/authorize.html +++ b/app/oauth/templates/oauth/authorize.html @@ -109,11 +109,11 @@ style="padding-left: 5px">