Add Only enabled alias sorting option
This commit is contained in:
parent
4c64393df1
commit
12714ae601
|
@ -139,6 +139,9 @@ def get_alias_infos_with_pagination_v2(
|
||||||
or_(Alias.email.ilike(f"%{query}%"), Alias.note.ilike(f"%{query}%"))
|
or_(Alias.email.ilike(f"%{query}%"), Alias.note.ilike(f"%{query}%"))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if sort == "enabled":
|
||||||
|
q = q.filter(Alias.enabled)
|
||||||
|
|
||||||
if sort == "old2new":
|
if sort == "old2new":
|
||||||
q = q.order_by(Alias.created_at)
|
q = q.order_by(Alias.created_at)
|
||||||
elif sort == "new2old":
|
elif sort == "new2old":
|
||||||
|
|
|
@ -81,6 +81,9 @@
|
||||||
<option value="z2a" {% if sort == "z2a" %} selected {% endif %}>
|
<option value="z2a" {% if sort == "z2a" %} selected {% endif %}>
|
||||||
Alias Z-A
|
Alias Z-A
|
||||||
</option>
|
</option>
|
||||||
|
<option value="enabled" {% if sort == "enabled" %} selected {% endif %}>
|
||||||
|
Only Enabled Alias
|
||||||
|
</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<input type="search" name="query" placeholder="Enter to search for alias"
|
<input type="search" name="query" placeholder="Enter to search for alias"
|
||||||
|
|
|
@ -8,17 +8,15 @@ from flask import Flask, redirect, url_for, render_template, request, jsonify, f
|
||||||
from flask_admin import Admin
|
from flask_admin import Admin
|
||||||
from flask_cors import cross_origin
|
from flask_cors import cross_origin
|
||||||
from flask_login import current_user
|
from flask_login import current_user
|
||||||
|
from sentry_sdk.integrations.aiohttp import AioHttpIntegration
|
||||||
from sentry_sdk.integrations.flask import FlaskIntegration
|
from sentry_sdk.integrations.flask import FlaskIntegration
|
||||||
from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration
|
from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration
|
||||||
from sentry_sdk.integrations.aiohttp import AioHttpIntegration
|
|
||||||
|
|
||||||
|
|
||||||
from app import paddle_utils
|
from app import paddle_utils
|
||||||
from app.admin_model import SLModelView, SLAdminIndexView
|
from app.admin_model import SLModelView, SLAdminIndexView
|
||||||
from app.api.base import api_bp
|
from app.api.base import api_bp
|
||||||
from app.auth.base import auth_bp
|
from app.auth.base import auth_bp
|
||||||
from app.config import (
|
from app.config import (
|
||||||
DEBUG,
|
|
||||||
DB_URI,
|
DB_URI,
|
||||||
FLASK_SECRET,
|
FLASK_SECRET,
|
||||||
SENTRY_DSN,
|
SENTRY_DSN,
|
||||||
|
@ -182,6 +180,11 @@ def fake_data():
|
||||||
EmailLog.create(user_id=user.id, contact_id=contact.id)
|
EmailLog.create(user_id=user.id, contact_id=contact.id)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
|
# have some disabled alias
|
||||||
|
if i % 5 == 0:
|
||||||
|
a.enabled = False
|
||||||
|
db.session.commit()
|
||||||
|
|
||||||
CustomDomain.create(user_id=user.id, domain="ab.cd", verified=True)
|
CustomDomain.create(user_id=user.id, domain="ab.cd", verified=True)
|
||||||
CustomDomain.create(
|
CustomDomain.create(
|
||||||
user_id=user.id, domain="very-long-domain.com.net.org", verified=True
|
user_id=user.id, domain="very-long-domain.com.net.org", verified=True
|
||||||
|
|
Loading…
Reference in a new issue