fixed bug where anonymous user can't view work page
parent
e38d78ecc3
commit
f96b5e4637
|
@ -157,6 +157,7 @@ $(document).ready(function(){
|
|||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% if not user.is_anonymous %}
|
||||
{% if request.user.rights_holder.all.count %}
|
||||
<h4> Claim this work:</h4>
|
||||
<form method="GET" action="{% url claim %}">
|
||||
|
@ -167,6 +168,7 @@ $(document).ready(function(){
|
|||
<input type="submit" name="submit" value="Claim" id="submit">
|
||||
</form>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -59,8 +59,10 @@ def stub(request):
|
|||
def work(request, work_id, action='display'):
|
||||
work = get_object_or_404(models.Work, id=work_id)
|
||||
campaign = work.last_campaign()
|
||||
|
||||
claimform = UserClaimForm( request.user, data={'work':work_id, 'user': request.user.id})
|
||||
if not request.user.is_anonymous():
|
||||
claimform = UserClaimForm( request.user, data={'work':work_id, 'user': request.user.id})
|
||||
else:
|
||||
claimform = None
|
||||
if campaign:
|
||||
q = Q(campaign=campaign) | Q(campaign__isnull=True)
|
||||
premiums = models.Premium.objects.filter(q)
|
||||
|
|
Loading…
Reference in New Issue