File tree Expand file tree Collapse file tree 4 files changed +2
-19
lines changed
Expand file tree Collapse file tree 4 files changed +2
-19
lines changed Original file line number Diff line number Diff line change 1919from projects .models import Project
2020from projects .permissions import ObjectPermission
2121from questions .models import Question , UserForecastNotification
22- from questions .utils import get_question_group_title
2322from users .models import User
2423from utils .dtypes import dataclass_from_dict
2524from utils .email import send_email_with_template
@@ -202,10 +201,6 @@ def format_cp_change_value(self):
202201 def format_cp_median (self ):
203202 return self .format_value (self .cp_median )
204203
205- def format_question_title (self ):
206- # TODO: deprecate get_question_group_title after the first release of this change
207- return self .question .label or get_question_group_title (self .question .title )
208-
209204
210205class NotificationTypeBase :
211206 type : str
Original file line number Diff line number Diff line change 242242 </ tr >
243243 </ thead >
244244 < tbody > {% for item in notification.question_data %} < tr style ="{% if not forloop.last %}border-bottom: 1px solid #E5E7EB;{% endif %} ">
245- < td style ="padding: 8px; text-align: left; font-size: 13px; color: #161C22; "> {% if item.question.type == "multiple_choice" %} {{ item.label }} {% else %} {{ item.format_question_title }} {% endif %} </ td >
245+ < td style ="padding: 8px; text-align: left; font-size: 13px; color: #161C22; "> {% if item.question.type == "multiple_choice" %} {{ item.label }} {% else %} {{ item.question.label }} {% endif %} </ td >
246246 < td style ="padding: 8px 4px; text-align: center; font-size: 13px; font-weight: 600; color: #161C22; ">
247247 {{ item.get_cp_change_symbol }}{{item.format_cp_change_value }}
248248 </ td >
Original file line number Diff line number Diff line change 107107 {% if item.question.type == "multiple_choice" %}
108108 {{ item.label }}
109109 {% else %}
110- {{ item.format_question_title }}
110+ {{ item.question.label }}
111111 {% endif %}
112112 </td >
113113 <td style =" padding: 8px 4px; text-align: center; font-size: 13px; font-weight: 600; color: #161C22;" >
Original file line number Diff line number Diff line change 11import datetime
2- import re
32from datetime import timedelta
43
54from django .utils import timezone
65
76from questions .models import Question , AggregateForecast , Forecast
87
98
10- def get_question_group_title (title : str ) -> str :
11- """
12- Extracts name from question of group.
13-
14- E.g. Long Question Title? (Option A) -> Option A
15- """
16-
17- matches = re .findall (r"\((?:[^()]*|\([^()]*\))*\)" , title )
18- return matches [- 1 ][1 :- 1 ] if matches else title
19-
20-
219def calculate_question_lifespan_from_date (
2210 question : Question , from_date : datetime .datetime
2311) -> float | None :
You can’t perform that action at this time.
0 commit comments