+
+
diff --git a/app/dashboard/views/index.py b/app/dashboard/views/index.py
index 40c981e0..b595bc18 100644
--- a/app/dashboard/views/index.py
+++ b/app/dashboard/views/index.py
@@ -3,7 +3,6 @@ from flask_login import login_required, current_user
from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm import joinedload
-from app import email_utils
from app.api.serializer import get_alias_infos_with_pagination_v2
from app.dashboard.base import dashboard_bp
from app.extensions import db
@@ -13,7 +12,6 @@ from app.models import (
ClientUser,
DeletedAlias,
AliasGeneratorEnum,
- Mailbox,
)
@@ -22,6 +20,7 @@ from app.models import (
def index():
query = request.args.get("query") or ""
sort = request.args.get("sort") or ""
+ alias_filter = request.args.get("filter") or ""
page = 0
if request.args.get("page"):
@@ -61,6 +60,7 @@ def index():
highlight_alias_id=alias.id,
query=query,
sort=sort,
+ filter=alias_filter,
)
)
else:
@@ -77,6 +77,7 @@ def index():
highlight_alias_id=alias.id,
query=query,
sort=sort,
+ filter=alias_filter,
)
)
@@ -95,7 +96,9 @@ def index():
LOG.error("alias %s has been added before to DeletedAlias", email)
db.session.rollback()
- return redirect(url_for("dashboard.index", query=query, sort=sort))
+ return redirect(
+ url_for("dashboard.index", query=query, sort=sort, filter=alias_filter)
+ )
client_users = (
ClientUser.filter_by(user_id=current_user.id)
@@ -120,7 +123,9 @@ def index():
return render_template(
"dashboard/index.html",
client_users=client_users,
- alias_infos=get_alias_infos_with_pagination_v2(current_user, page, query, sort),
+ alias_infos=get_alias_infos_with_pagination_v2(
+ current_user, page, query, sort, alias_filter
+ ),
highlight_alias_id=highlight_alias_id,
query=query,
AliasGeneratorEnum=AliasGeneratorEnum,
@@ -128,4 +133,5 @@ def index():
show_intro=show_intro,
page=page,
sort=sort,
+ filter=alias_filter,
)
diff --git a/server.py b/server.py
index 540d7ee4..2e18a105 100644
--- a/server.py
+++ b/server.py
@@ -8,17 +8,15 @@ from flask import Flask, redirect, url_for, render_template, request, jsonify, f
from flask_admin import Admin
from flask_cors import cross_origin
from flask_login import current_user
+from sentry_sdk.integrations.aiohttp import AioHttpIntegration
from sentry_sdk.integrations.flask import FlaskIntegration
from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration
-from sentry_sdk.integrations.aiohttp import AioHttpIntegration
-
from app import paddle_utils
from app.admin_model import SLModelView, SLAdminIndexView
from app.api.base import api_bp
from app.auth.base import auth_bp
from app.config import (
- DEBUG,
DB_URI,
FLASK_SECRET,
SENTRY_DSN,
@@ -182,6 +180,11 @@ def fake_data():
EmailLog.create(user_id=user.id, contact_id=contact.id)
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="very-long-domain.com.net.org", verified=True