manager: s/unknown/anonymous on bookings (#54075)

This commit is contained in:
Lauréline Guérin 2021-05-21 11:22:16 +02:00
parent 559131e62e
commit 306b08cfe7
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
2 changed files with 9 additions and 9 deletions

View File

@ -743,7 +743,7 @@ class Agenda(models.Model):
def get_booking_user_block_template(self):
return (
self.booking_user_block_template
or '{{ booking.user_name|default:booking.label|default:"%s" }}' % _('Unknown')
or '{{ booking.user_name|default:booking.label|default:"%s" }}' % _('Anonymous')
)
def get_recurrence_exceptions(self, min_start, max_start):
@ -1743,7 +1743,7 @@ class Booking(models.Model):
return new_booking
def events_display(self):
name = self.user_name or self.label or _('Unknown')
name = self.user_name or self.label or _('Anonymous')
return '%s, %s' % (name, date_format(localtime(self.creation_datetime), 'DATETIME_FORMAT'))
def meetings_display(self):

View File

@ -529,7 +529,7 @@ def test_options_agenda_booking_check_options(app, admin_user):
assert agenda.booking_user_block_template == ''
assert (
agenda.get_booking_user_block_template()
== '{{ booking.user_name|default:booking.label|default:"Unknown" }}'
== '{{ booking.user_name|default:booking.label|default:"Anonymous" }}'
)
app = login(app)
@ -548,7 +548,7 @@ def test_options_agenda_booking_check_options(app, admin_user):
assert agenda.booking_user_block_template == ''
assert (
agenda.get_booking_user_block_template()
== '{{ booking.user_name|default:booking.label|default:"Unknown" }}'
== '{{ booking.user_name|default:booking.label|default:"Anonymous" }}'
)
# check filters
@ -3308,11 +3308,11 @@ def test_agenda_view_event(app, manager_user):
event.save()
resp = app.get(resp.request.url)
assert 'Waiting List (0/5): 5 remaining places' in resp.text
assert 'Unknown, Dec. 21, 2019, 2 p.m.' in resp.text
assert 'Unknown, Dec. 21, 2019, 2:01 p.m.' in resp.text
assert 'Unknown, Dec. 21, 2019, 2:02 p.m.' in resp.text
assert 'Unknown, Dec. 21, 2019, 2:03 p.m.' in resp.text
assert 'Unknown, Dec. 21, 2019, 2:04 p.m.' in resp.text
assert 'Anonymous, Dec. 21, 2019, 2 p.m.' in resp.text
assert 'Anonymous, Dec. 21, 2019, 2:01 p.m.' in resp.text
assert 'Anonymous, Dec. 21, 2019, 2:02 p.m.' in resp.text
assert 'Anonymous, Dec. 21, 2019, 2:03 p.m.' in resp.text
assert 'Anonymous, Dec. 21, 2019, 2:04 p.m.' in resp.text
assert 'Foo Bar User, Dec. 21, 2019, 3 p.m.' in resp.text
assert 'Foo Bar User 2, Dec. 21, 2019, 4 p.m.' in resp.text
assert 'Foo Bar Label 3, Dec. 21, 2019, 5 p.m.' in resp.text