mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-06 09:57:57 +00:00
Don't error out if there are no approved quotes avaliable
This commit is contained in:
@ -32,7 +32,10 @@ from forms import OrganisationForm
|
||||
def home(request):
|
||||
news = NewsArticle.objects.filter(approved=True)[:5]
|
||||
events = Event.objects.select_related('country').filter(approved=True, training=False, enddate__gt=date.today).order_by('enddate', 'startdate')[:3]
|
||||
quote = Quote.objects.filter(approved=True).order_by('?')[0]
|
||||
try:
|
||||
quote = Quote.objects.filter(approved=True).order_by('?')[0]
|
||||
except:
|
||||
pass # if there is no quote available, just ignore error
|
||||
versions = Version.objects.all()
|
||||
planet = ImportedRSSItem.objects.filter(feed__internalname="planet").order_by("-posttime")[:5]
|
||||
|
||||
|
Reference in New Issue
Block a user