Merge branch 'master' into test_credit

pull/1/head
Raymond Yee 2013-12-17 15:53:54 -08:00
commit dd30ed81c2
2 changed files with 6 additions and 4 deletions

View File

@ -32,7 +32,7 @@
<p><b>Library Username</b>: {{ form.instance.user }}</p> <p><b>Library Username</b>: {{ form.instance.user }}</p>
<p><b>Library Email</b>: {{ form.instance.user.email }}</p> <p><b>Library Email</b>: {{ form.instance.user.email }}</p>
{% else %} {% else %}
<p><b>Library Username</b>: {{ form.username.errors }}{{ form.username }} This will be the Unglue.it username for the library. You'll be able to log in as the library to do things like setting links making book lists.</p> <p><b>Library Username</b>: {{ form.username.errors }}{{ form.username }} This will be the Unglue.it username for the library. You ( <i>{{ request.user }}</i> ) will be able to log in as the library to do things like setting links making book lists.</p>
<p><b>Library Email</b>: {{ form.email.errors }}{{ form.email }} The notification address for the library.</p> <p><b>Library Email</b>: {{ form.email.errors }}{{ form.email }} The notification address for the library.</p>
{% endif %} {% endif %}
@ -49,14 +49,15 @@
{% else %} {% else %}
<li> This library has not yet been approved by Unglue.it staff. Please make sure that a <a href="https://www.docracy.com/0_uyw26qv9c/unglue-it-library-license-agreement">library agreement</a> has been executed.</li> <li> This library has not yet been approved by Unglue.it staff. Please make sure that a <a href="https://www.docracy.com/0_uyw26qv9c/unglue-it-library-license-agreement">library agreement</a> has been executed.</li>
{% endif %} {% endif %}
<li> Go to <a href="{% url library library.user %}">{{ library }} Page</a></li> <li> Go to <a href="{% url library library.user %}">{{ library }}'s page</a></li>
<li> Go to <a href="{% url supporter library.user %}"><i>{{ library.user }}</i>'s user page</a></li>
{% ifequal request.user library.user %} {% ifequal request.user library.user %}
<li> <i>You are logged in as the library user.</i> You can...</li> <li> <i>You are logged in as the library user ( {{ library.user }} ).</i> You can...</li>
<li> ... edit the <a href="{% url supporter library.user %}#edit">Profile Settings</a> or ... </li> <li> ... edit the <a href="{% url supporter library.user %}#edit">Profile Settings</a> or ... </li>
<li> ... <a href="{% url manage_account %}">configure</a> the library's account</li> <li> ... <a href="{% url manage_account %}">configure</a> the library's account</li>
{% else %} {% else %}
{% ifequal request.user library.owner %} {% ifequal request.user library.owner %}
<li> To set links and tagline, configure the account, and build book lists for {{ library }}, first <a href="{% url library_login library.id %}">click here to log in</a> as the library user </li> <li> To set links and tagline, configure the account, and build book lists for {{ library }}, first <br /> <br /><a class="fakeinput" href="{% url library_login library.id %}">log in as {{ library.user }}</a></li>
{% else %} {% else %}
<li> <i>{{ library.owner }}</i> is authorized to set links and tagline, configure the account, and build book lists for {{ library }}.</li> <li> <i>{{ library.owner }}</i> is authorized to set links and tagline, configure the account, and build book lists for {{ library }}.</li>
{% endifequal %} {% endifequal %}

View File

@ -107,6 +107,7 @@ class CreateLibraryView(BaseLibraryView, CreateView):
user.save() user.save()
form.instance.user = user form.instance.user = user
form.instance.save() form.instance.save()
form.instance.add_user(user)
context_data = self.get_context_data(form=form) context_data = self.get_context_data(form=form)
context_data['status'] = 'Library Updated' context_data['status'] = 'Library Updated'
return HttpResponseRedirect(reverse('library_admin',args=[form.instance.id])) return HttpResponseRedirect(reverse('library_admin',args=[form.instance.id]))