order api key by created order

This commit is contained in:
Son NK 2020-04-28 20:08:45 +02:00
parent e1d8c55a66
commit d453c83974
1 changed files with 5 additions and 1 deletions

View File

@ -15,7 +15,11 @@ class NewApiKeyForm(FlaskForm):
@dashboard_bp.route("/api_key", methods=["GET", "POST"])
@login_required
def api_key():
api_keys = ApiKey.query.filter(ApiKey.user_id == current_user.id).all()
api_keys = (
ApiKey.query.filter(ApiKey.user_id == current_user.id)
.order_by(ApiKey.created_at.desc())
.all()
)
new_api_key_form = NewApiKeyForm()