b2u for libraries
1. library license is autochecked when user is the library 2. the library owner is automatically made a member of the librarypull/1/head
parent
878970df4b
commit
13bd024f1f
|
@ -127,7 +127,7 @@
|
|||
<li class="last">
|
||||
{% if request.user.profile.libraries %}
|
||||
<label for="offer_{{offer.id}}">
|
||||
<input type="radio" name="offer_id" id="offer_{{offer.id}}" value="{{offer.id}}" {% ifequal request.REQUEST.offer_id offer.id|stringformat:"s" %}checked="checked"{% else %} {% ifequal offer_id offer.id %}checked="checked"{% endifequal %}{% endifequal %} />
|
||||
<input type="radio" name="offer_id" id="offer_{{offer.id}}" value="{{offer.id}}" {% ifequal request.REQUEST.offer_id offer.id|stringformat:"s" %}checked="checked"{% else %} {% ifequal offer_id offer.id %}checked="checked"{% else %} {% if user.library %}checked="checked"{% endif %}{% endifequal %}{% endifequal %} />
|
||||
<span class="menu-item-price">
|
||||
${{ offer.price|intcomma }}
|
||||
</span>
|
||||
|
|
|
@ -108,7 +108,8 @@ class CreateLibraryView(BaseLibraryView, CreateView):
|
|||
user.save()
|
||||
form.instance.user = user
|
||||
form.instance.save()
|
||||
form.instance.add_user(user)
|
||||
form.instance.add_user(user) # library is a member of itself
|
||||
form.instance.add_user(self.request.user) # library.owner is a member of library
|
||||
context_data = self.get_context_data(form=form)
|
||||
context_data['status'] = 'Library Updated'
|
||||
return HttpResponseRedirect(reverse('library_admin',args=[form.instance.id]))
|
||||
|
|
Loading…
Reference in New Issue