datasources: auto agenda ds & dynamic meeting type (#77497) #405

Merged
lguerin merged 1 commits from wip/77497-chrono-ds-dynamic into main 2023-06-23 08:45:15 +02:00
2 changed files with 17 additions and 0 deletions

View File

@ -172,6 +172,11 @@ def test_collect_agenda_data(pub, chrono_url):
'text': 'Meetings A - Meeting types',
'url': 'http://chrono.example.net/api/agenda/meetings-A/meetings/',
},
{
'slug': 'agenda-meetings-meetings-A-mtdynamic',
'text': 'Meetings A - Slots of type form_var_meeting_type',
'url': 'http://chrono.example.net/api/agenda/meetings-A/meetings/{{ form_var_meeting_type }}/datetimes/',
},
{
'slug': 'agenda-meetings-meetings-A-mt-mt-1',
'text': 'Meetings A - Slots of type MT 1 (30 minutes)',
@ -187,6 +192,11 @@ def test_collect_agenda_data(pub, chrono_url):
'text': 'Virtual B - Meeting types',
'url': 'http://chrono.example.net/api/agenda/virtual-B/meetings/',
},
{
'slug': 'agenda-virtual-virtual-B-mtdynamic',
'text': 'Virtual B - Slots of type form_var_meeting_type',
'url': 'http://chrono.example.net/api/agenda/virtual-B/meetings/{{ form_var_meeting_type }}/datetimes/',
},
{
'slug': 'agenda-virtual-virtual-B-mt-mt-3',
'text': 'Virtual B - Slots of type MT 3 (60 minutes)',

View File

@ -1169,6 +1169,13 @@ def collect_agenda_data(publisher):
'url': agenda['api']['meetings_url'],
}
)
agenda_data.append(
{
'slug': 'agenda-%s-%s-mtdynamic' % (agenda['kind'], agenda['id']),
tnoel marked this conversation as resolved Outdated
Outdated
Review

On pourrait imaginer un conflit de slug ici, car on a plus bas dans le code un

'slug': 'agenda-%s-%s-mt-%s' % (agenda['kind'], agenda['id'], meetingtype['id'])

où meetingtype['id'] pourrait être "dynamic" si quelqu'un nomme ainsi son type de rendez-vous...

Peut-être qu'un « agenda-%s-%s-mtdynamic » serait ici utile...

On pourrait imaginer un conflit de slug ici, car on a plus bas dans le code un 'slug': 'agenda-%s-%s-mt-%s' % (agenda['kind'], agenda['id'], meetingtype['id']) où meetingtype['id'] pourrait être "dynamic" si quelqu'un nomme ainsi son type de rendez-vous... Peut-être qu'un « agenda-%s-%s-mtdynamic » serait ici utile...

yes bien vu

yes bien vu
'text': _('%s - Slots of type form_var_meeting_type') % agenda['text'],
'url': '%s{{ form_var_meeting_type }}/datetimes/' % agenda['api']['meetings_url'],
}
)
# get also meeting types
mt_url = chrono_url(publisher, 'api/agenda/%s/meetings/' % agenda['id'])
mt_results = get_json_from_url(mt_url, log_message_part='agenda')