Skip to content

Commit

Permalink
Pootle Site: Return default value if no PootleSite object exists
Browse files Browse the repository at this point in the history
This fixes the tests failures.
  • Loading branch information
unho committed Apr 8, 2014
1 parent 35ccf47 commit 9fdfb70
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pootle/apps/pootle_app/models/pootle_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,19 @@


def get_site_title():
pootle_site = PootleSite.objects.get_current()
return pootle_site.title
try:
pootle_site = PootleSite.objects.get_current()
return pootle_site.title
except Exception:
return PootleSite._meta.get_field('title').default


def get_site_description():
pootle_site = PootleSite.objects.get_current()
return pootle_site.description
try:
pootle_site = PootleSite.objects.get_current()
return pootle_site.description
except Exception:
return PootleSite._meta.get_field('description').default


def get_legacy_site_title():
Expand Down

0 comments on commit 9fdfb70

Please sign in to comment.