Skip to content

Commit

Permalink
Misc bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mhall119 committed Dec 14, 2018
1 parent f63fadb commit 06870d6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{% for speaker in speaker_bios %}
<div class="col-md-4">
<div class="card mb-4 box-shadow" style="width: 18rem;">
<div class="card-img-top mt-1" style="text-align: center"><img src="{{speaker.headshot.url}}"/></div>
<div class="card-img-top mt-1" style="text-align: center"><img src="{{speaker.headshot_url}}"/></div>
<div class="card-body">
<p class="card-title" style="height: 2rem;">
<strong><a href="{% url 'edit-speaker' speaker.id %}">{{speaker.title}}</a></strong>
Expand Down
1 change: 1 addition & 0 deletions get_together/views/new_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,5 @@ def user_confirm_notifications(request):
if form.is_valid():
form.save()
return redirect('home')
return redirect('home')

21 changes: 11 additions & 10 deletions totd/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ def tips(request):
return {}

#import pdb; pdb.set_trace()
try:
tips = Tip.objects.filter(run_start__lte=datetime.datetime.now())
tips = tips.filter(Q(run_end__isnull=True) | Q(run_end__gte=datetime.datetime.now()))
tips = tips.filter(Q(view='') | Q(view=request.resolver_match.url_name)).exclude(seen_by=request.user)
if len(tips) > 0:
tips[0].seen_by.add(request.user)

tips = Tip.objects.filter(run_start__lte=datetime.datetime.now())
tips = tips.filter(Q(run_end__isnull=True) | Q(run_end__gte=datetime.datetime.now()))
tips = tips.filter(Q(view='') | Q(view=request.resolver_match.url_name)).exclude(seen_by=request.user)
if len(tips) > 0:
tips[0].seen_by.add(request.user)

return {
'tip': tips[0],
}

return {
'tip': tips[0],
}
except:
pass # Don't show a TotD if anything went wrong
return {}

0 comments on commit 06870d6

Please sign in to comment.