diff --git a/tildes/tildes/templates/intercooler/invite_code.jinja2 b/tildes/tildes/templates/intercooler/invite_code.jinja2 index dd81f1f..5f4a7f7 100644 --- a/tildes/tildes/templates/intercooler/invite_code.jinja2 +++ b/tildes/tildes/templates/intercooler/invite_code.jinja2 @@ -1,12 +1,18 @@ - +
You don't currently have any invite codes available.
+ {% endif %} +You have the following invite codes active that have not been used yet:
+You don't currently have any invite codes available.
+ {% endif %} + {% if codes %} -You have the following invite codes active that have not been used yet:
+You have the following invite codes active that have not been used yet:
+You don't currently have any invite codes available.
+ {% endif %} + {% endblock %} diff --git a/tildes/tildes/views/user.py b/tildes/tildes/views/user.py index 3b3da0b..220a4d4 100644 --- a/tildes/tildes/views/user.py +++ b/tildes/tildes/views/user.py @@ -70,6 +70,7 @@ def get_invite(request: Request) -> dict: UserInviteCode.user_id == request.user.user_id, UserInviteCode.invitee_id == None, # noqa ) + .order_by(desc(UserInviteCode.created_time)) .all() )