Skip to content

Commit 9593c8f

Browse files
Merge pull request #164 from sei-vsarvepalli/version-3.0.11
Version 3.0.11
2 parents 40fb2df + a25de39 commit 9593c8f

File tree

7 files changed

+89
-25
lines changed

7 files changed

+89
-25
lines changed

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
CHANGELOG
44
VINCE Coordination platform code
55

6+
Version 3.0.11 2024-12-11
7+
8+
* Update to fix "Reply to User" button further scenarios.
9+
10+
Version 3.0.10 2024-12-10
11+
12+
* Dependabot update recommendations: `django` 4.2.17 to 4.2.16
13+
* Fixed bug preventing the "Reply to User" buttons from working in certain circumstances
14+
* Added pk to CaseAPIView (GH-Issue #162)
15+
16+
617
Version 3.0.9 2024-10-28
718

819
* Update to fix Security issue with enumerate users in vincecomm (Internal-783 CVE-2024-10469)

bigvince/settings_.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
ROOT_DIR = environ.Path(__file__) - 3
5555

5656
# any change that requires database migrations is a minor release
57-
VERSION = "3.0.9"
57+
VERSION = "3.0.11"
5858

5959
# Quick-start development settings - unsuitable for production
6060
# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ cryptography==43.0.1
2424
cvelib==1.3.0
2525
Deprecated==1.2.13
2626
dictdiffer==0.9.0
27-
Django==4.2.16
27+
Django==4.2.17
2828
django-appconf==1.0.5
2929
django-countries==7.4.2
3030
django-environ==0.9.0

vince/templates/vince/ticket_activity.html

+20-21
Original file line numberDiff line numberDiff line change
@@ -25,34 +25,33 @@ <h3 class="section-title">
2525
<div class="large-12 columns">
2626
<div class="article-row-section">
2727
<div class="article-row-section-inner">
28-
{% for followup in ticket.get_actions %}
28+
{% for followup in followups %}
2929
<div class="article-row">
30-
3130
<div class="article-row-img">
3231
{% autoescape off %}
33-
{% if followup.user %}
34-
{{ followup.user|vtuserlogo:"profile-pic" }}
32+
{% if followup.fup.user %}
33+
{{ followup.fup.user|vtuserlogo:"profile-pic" }}
3534
{% else %}
36-
{{ followup.html_logo }}
35+
{{ followup.fup.html_logo }}
3736
{% endif %}
3837
{% endautoescape %}
3938
</div>
4039
<div class="article-row-content">
41-
<p class="article-row-content-description trescaped">{{ followup.title|escape|email_to_user }} {% if followup.title in "Comment,Closed" and followup.user == user %} <small><a href="{% url 'vince:followup_edit' followup.id %}" class='followup-edit'><i class="fas fa-edit" title="Edit this comment"></i></a></small>{% elif "Email" in followup.title %}{% if followup.email_id %}<span class="email-detail" title="{{ followup.email_id }} in {{ followup.email_bucket }}"><i class="fas fa-envelope-open-text"></i></span>{% endif %}{% endif %}</p>
40+
<p class="article-row-content-description trescaped">{{ followup.fup.title|escape|email_to_user }} {% if followup.fup.title in "Comment,Closed" and followup.fup.user == user %} <small><a href="{% url 'vince:followup_edit' followup.fup.id %}" class='followup-edit'><i class="fas fa-edit" title="Edit this comment"></i></a></small>{% elif "Email" in followup.fup.title %}{% if followup.fup.email_id %}<span class="email-detail" title="{{ followup.fup.email_id }} in {{ followup.fup.email_bucket }}"><i class="fas fa-envelope-open-text"></i></span>{% endif %}{% endif %}</p>
4241
<p class="article-row-content-detail">
43-
{% if followup.comment|is_json %}
42+
{% if followup.fup.comment|is_json %}
4443
<div class="long_text_container">
4544
<div class="text_container textheightshort">
4645
<div class="text_content">
47-
{{ followup.comment }}
46+
{{ followup.fup.comment }}
4847
</div>
4948
</div>
5049
</div>
51-
{% elif followup.comment %}
50+
{% elif followup.fup.comment %}
5251
<div class="long_text_container">
5352
<div class="text_container textheightshort">
5453
<div class="text_content">
55-
{{ followup.comment|force_escape|smarter_urlize:50|linebreaksbr }}
54+
{{ followup.fup.comment|force_escape|smarter_urlize:50|linebreaksbr }}
5655
</div>
5756
</div>
5857
<div class="showfull moretext"><i class="fas fa-arrow-down"></i> Show More</div>
@@ -64,39 +63,39 @@ <h3 class="section-title">
6463
<a href="{% url 'vince:contact' contact_link %}">View changes.</a>
6564
{% endif %}
6665
</p>
67-
{% for change in followup.ticketchange_set.all %}
66+
{% for change in followup.fup.ticketchange_set.all %}
6867
{% if forloop.first %}<div class='changes'><ul>{% endif %}
6968
<li>{% blocktrans with change.field as field and change.old_value as old_value and change.new_value as new_value %}Changed {{field }} from {{ old_value }} to {{ new_value }}.{% endblocktrans %}</li>
7069
{% if forloop.last %}</ul></div>{% endif %}
7170
{% endfor %}
72-
{% for attachment in followup.attachment_set.all %}
71+
{% for attachment in followup.fup.attachment_set.all %}
7372
{% if forloop.first %}<div class='attachments'><ul>{% endif %}
7473
<li><a href="{% url 'vince:attachment' attachment.uuid %}">{{ attachment.filename }}</a> ({{ attachment.mime_type }}, {{ attachment.size|filesizeformat }})</li>
7574
{% if forloop.last %}</ul></div>{% endif %}
7675
{% endfor %}
77-
{% if "commented on report" in followup.title %}
76+
{% if "commented on report" in followup.fup.title %}
7877
<div>
7978
<a href="{{ vincecomm_link }}"> <button type="button" class="button primary tiny"> <i class="fas fa-reply"></i> Respond</button></a>
8079
</div>
8180
{% endif %}
82-
{% for message in followup.followupmessage_set.all %}
81+
{% for message in followup.msgset %}
8382
<div>
84-
<a href="{% url 'vinny:msg_detail' message.msg %}">
85-
<button type="button" class="button primary tiny"> <i class="fas fa-reply"></i> Reply to User</button>
83+
<a href="{% url 'vinny:msg_detail' message.pk %}">
84+
<button type="button" class="button primary tiny"> <i class="fas fa-reply"></i> Reply to {{ message.sender.first_name }} {{ message.sender.last_name }}</button>
8685
</a>
8786
</div>
8887
{% endfor %}
89-
{% if followup.title|review:followup and followup.ticket.review %}
88+
{% if followup.fup.title|review:followup.fup and followup.fup.ticket.review %}
9089
<div>
91-
<a href="{% url 'vince:reviewdetail' followup.ticket.review.id %}">
90+
<a href="{% url 'vince:reviewdetail' followup.fup.ticket.review.id %}">
9291
<button type="button" class="button primary tiny"> View Review</button>
9392
</a>
9493
</div>
9594
{% endif %}
96-
<time class="article-row-content-time">{{ followup.date|date:"Y-m-d H:i" }} ({{ followup.date|naturaltime }}) {% if followup.user %} by {{ followup.user.usersettings.vince_username }}{% endif %} {% if followup.last_edit %}<b><i class="fas fa-edit"></i> Edited: {{ followup.last_edit|date:"Y-m-d" }}</b>{% endif %}</time>
97-
{% if followup.is_email %}
95+
<time class="article-row-content-time">{{ followup.fup.date|date:"Y-m-d H:i" }} ({{ followup.fup.date|naturaltime }}) {% if followup.fup.user %} by {{ followup.fup.user.usersettings.vince_username }}{% endif %} {% if followup.fup.last_edit %}<b><i class="fas fa-edit"></i> Edited: {{ followup.fup.last_edit|date:"Y-m-d" }}</b>{% endif %}</time>
96+
{% if followup.fup.is_email %}
9897
<div class="edit-hover">
99-
<a href="{% url 'vince:replyemail' followup.id %}" type="button" class="edit-btn button primary" title="Reply to Email"><i aria-hidden="true" class="fas fa-reply"></i></a>
98+
<a href="{% url 'vince:replyemail' followup.fup.id %}" type="button" class="edit-btn button primary" title="Reply to Email"><i aria-hidden="true" class="fas fa-reply"></i></a>
10099
</div>
101100
{% endif %}
102101
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#########################################################################
2+
# VINCE
3+
#
4+
# Copyright 2023 Carnegie Mellon University.
5+
#
6+
# NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING
7+
# INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON
8+
# UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
9+
# AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR
10+
# PURPOSE OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE
11+
# MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND
12+
# WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT.
13+
#
14+
# Released under a MIT (SEI)-style license, please see license.txt or contact
15+
# [email protected] for full terms.
16+
#
17+
# [DISTRIBUTION STATEMENT A] This material has been approved for public
18+
# release and unlimited distribution. Please see Copyright notice for non-US
19+
# Government use and distribution.
20+
#
21+
# Carnegie Mellon®, CERT® and CERT Coordination Center® are registered in the
22+
# U.S. Patent and Trademark Office by Carnegie Mellon University.
23+
#
24+
# This Software includes and/or makes use of Third-Party Software each subject
25+
# to its own license.
26+
#
27+
# DM21-1126
28+
########################################################################
29+
from django import template
30+
31+
# from vinny.models import Message
32+
33+
register = template.Library()
34+
35+
36+
@register.filter
37+
def get_vincecomm_messages(id):
38+
# return Message.objects.filter(pk=id)
39+
return True

vince/views.py

+16-1
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@
179179
logger.setLevel(logging.DEBUG)
180180

181181

182+
def get_vincecomm_messages(id):
183+
return Message.objects.filter(pk=id).first()
184+
185+
182186
def normalize_time(instance, column):
183187
"""Time fields normalize and find issues"""
184188
if hasattr(instance, column):
@@ -5029,7 +5033,18 @@ def get_context_data(self, **kwargs):
50295033
context["ticketpage"] = 1
50305034
context["ticket"] = get_object_or_404(Ticket, id=self.kwargs["pk"])
50315035
context["more"] = False
5032-
logger.debug(f'in TicketActivityView, context["ticket"].get_actions() is {context["ticket"].get_actions()}')
5036+
followups = context["ticket"].get_actions()
5037+
5038+
list_of_fups_with_messages = []
5039+
for followup in followups:
5040+
fup_with_messages = {"fup": followup}
5041+
list_of_msg_values = []
5042+
for message in followup.followupmessage_set.all():
5043+
list_of_msg_values.append(get_vincecomm_messages(message.msg))
5044+
fup_with_messages["msgset"] = list_of_msg_values
5045+
list_of_fups_with_messages.append(fup_with_messages)
5046+
5047+
context["followups"] = list_of_fups_with_messages
50335048
if context["ticket"].followup_set.count() > Ticket.MAX_ACTIVITY:
50345049
if self.request.GET.get("all", None):
50355050
context["ticket"].MAX_ACTIVITY = 0

vinny/serializers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class CaseSerializer(serializers.ModelSerializer):
7878

7979
class Meta:
8080
model = Case
81-
fields = ("vuid", "created", "status", "summary", "title", "due_date", "modified")
81+
fields = ("vuid", "created", "status", "summary", "title", "due_date", "modified", "pk")
8282

8383
def get_status(self, obj):
8484
return obj.get_status_display()

0 commit comments

Comments
 (0)