Merge tag 'v9.22' into develop
session comments
This commit is contained in:
@@ -145,7 +145,7 @@
|
|||||||
</p>
|
</p>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<p>
|
<p>
|
||||||
<a href="/rowers/sessions/{{ race.id }}/comments/">Add a comment</a>
|
<a href="/rowers/sessions/{{ psdict.id.1 }}/comments/">Add a comment</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
Binary file not shown.
@@ -71,6 +71,23 @@ def plannedsession_comment_view(request,id=0,userid=0):
|
|||||||
)
|
)
|
||||||
|
|
||||||
commenters = {oc.user for oc in comments if oc.notification}
|
commenters = {oc.user for oc in comments if oc.notification}
|
||||||
|
if ps.sessiontype=='race':
|
||||||
|
registrations = VirtualRaceResult.objects.filter(
|
||||||
|
race__id=ps.id,
|
||||||
|
emailnotifications=True)
|
||||||
|
ids = [r.user.userid or r in registrations]
|
||||||
|
usrs = User.objects.filter(id in ids)
|
||||||
|
rowers = {u for u in usrs}
|
||||||
|
elif ps.sessiontype=='indoorrace':
|
||||||
|
registrations = IndoorVirtualRaceResult.objects.filter(
|
||||||
|
race__id=ps.id,
|
||||||
|
emailnotifications=True)
|
||||||
|
ids = [r.user.userid or r in registrations]
|
||||||
|
usrs = User.objects.filter(id in ids)
|
||||||
|
rowers = {u for u in usrs}
|
||||||
|
else:
|
||||||
|
rowers = {r.user for r in ps.rower.all()}
|
||||||
|
commenters = set(list(commenters)+list(rowers))
|
||||||
for u in commenters:
|
for u in commenters:
|
||||||
a_messages.info(u,message)
|
a_messages.info(u,message)
|
||||||
if u != request.user and u != r.user:
|
if u != request.user and u != r.user:
|
||||||
|
|||||||
Reference in New Issue
Block a user