Changed to using a template to generate bluesheets and added a count of participants at the top.
- Legacy-Id: 18344
This commit is contained in:
parent
fa49790bbe
commit
fcfc22bafd
|
@ -3098,12 +3098,15 @@ def api_upload_bluesheet(request):
|
|||
except json.decoder.JSONDecodeError:
|
||||
return err(400, "Invalid json value: '%s'" % (bjson, ))
|
||||
|
||||
text = render_to_string('meeting/bluesheet.txt', {
|
||||
'data': data,
|
||||
'session': session,
|
||||
})
|
||||
|
||||
fd, name = tempfile.mkstemp(suffix=".txt", text=True)
|
||||
os.close(fd)
|
||||
with open(name, "w") as file:
|
||||
file.write("Bluesheets for %s\n\n" % session)
|
||||
for item in data:
|
||||
file.write("{name}\t{affiliation}\n".format(**item))
|
||||
file.write(text)
|
||||
with open(name, "br") as file:
|
||||
save_err = save_bluesheet(request, session, file)
|
||||
if save_err:
|
||||
|
|
7
ietf/templates/meeting/bluesheet.txt
Normal file
7
ietf/templates/meeting/bluesheet.txt
Normal file
|
@ -0,0 +1,7 @@
|
|||
Bluesheet for {{session}}
|
||||
========================================================================
|
||||
|
||||
{{ data|length }} attendees.
|
||||
|
||||
{% for item in data %}
|
||||
{{ item.name }} {{ item.affiliation }}{% endfor %}
|
Loading…
Reference in a new issue