diff --git a/app/dashboard/views/setting.py b/app/dashboard/views/setting.py index cefbaf58..857905ab 100644 --- a/app/dashboard/views/setting.py +++ b/app/dashboard/views/setting.py @@ -227,6 +227,21 @@ def setting(): Session.commit() flash("Your preference has been updated", "success") return redirect(url_for("dashboard.setting")) + elif request.form.get("form-name") == "enable_data_breach_check": + if not current_user.is_premium(): + flash( + "Only premium plan can add enable data breach monitoring", "warning" + ) + return redirect(url_for("dashboard.setting")) + choose = request.form.get("enable_data_breach_check") + if choose == "on": + current_user.enable_data_breach_check = True + flash("Data breach monitoring is enabled", "success") + else: + current_user.enable_data_breach_check = False + flash("Data breach monitoring is disabled", "info") + Session.commit() + return redirect(url_for("dashboard.setting")) elif request.form.get("form-name") == "sender-in-ra": choose = request.form.get("enable") if choose == "on": diff --git a/templates/dashboard/setting.html b/templates/dashboard/setting.html index 03403766..ab6d865c 100644 --- a/templates/dashboard/setting.html +++ b/templates/dashboard/setting.html @@ -249,6 +249,42 @@ + +