Merged /branch/yaco/wgchairs.r3120/static/media:r3122-3152. Do no try to create an already existing model. See #671.

- Legacy-Id: 3557
This commit is contained in:
Henrik Levkowetz 2011-11-02 14:13:10 +00:00
commit 63dc422f43
2 changed files with 7 additions and 2 deletions

View file

@ -71,7 +71,12 @@ def _get_group_from_acronym(group_model_str, acronym):
def _set_stream_automatically(draft, stream):
streamed = StreamedID.objects.create(stream=stream, draft=draft)
(streamed, created) = StreamedID.objects.get_or_create(draft=draft)
if created:
streamed.stream = stream
streamed.save()
else:
return
if not stream or not stream.with_groups:
return
try:

View file

@ -2,7 +2,7 @@
<div class="stream_state" style="border: 1px solid black; padding: 0px 5px; margin: 5px 0px;">
<div class="stream_state_more" style="float: right; margin-left: 2em;"><a href="{% url stream_history draft.filename %}" class="show_stream_info" title="Stream information for {{ draft.filename }}" style="text-decoration: none; color: black;">+</a></div>
{% if stream %}
{{ stream }} {% if state %}:: {{ state }}{% endif %}
{{ stream }} {% if state %}:: {{ state.name }}{% endif %}
{% else %}
No stream assigned
{% endif %}