Permalink
Browse files

improved default_entity_id(); got rid of prints

  • Loading branch information...
1 parent 364292a commit e9dd27622b62f124622dd8c83f7002ec94a4d5e3 @evildmp committed Nov 8, 2012
Showing with 7 additions and 6 deletions.
  1. +7 −6 contacts_and_people/models.py
View
13 contacts_and_people/models.py
@@ -219,23 +219,24 @@ def base_entity(self):
try:
# are Entities available at all?
list(Entity.objects.all())
- print "** Entity objects are available from the database"
+ # print "** Entity objects are available from the database"
except:
# no - the database isn't ready
- print "** Entity objects are not available from the database"
+ # print "** Entity objects are not available from the database"
pass
else:
# we managed to get Entity.objects.all()
# we don't use default_entity (or default_entity_id) in MULTIPLE_ENTITY_MODE
try:
+ # print "trying"
entity = Entity.objects.get(id = base_entity_id)
# it can't be found, maybe because of a misconfiguation or because we haven't added any Entities yet
except (Entity.DoesNotExist, DatabaseError), e:
- print "** Either the Entity does not exist, or I got a DatabaseError:"
- print "**", e
+ # print "** Either the Entity does not exist, or I got a DatabaseError:"
+ # print "**", e
pass
else:
- print "** I successfully found a default entity:", entity
+ # print "** I successfully found a default entity:", entity
return entity
def default_entity_id(self):
@@ -426,7 +427,7 @@ def get_template(self):
if self.get_website:
return self.get_website.get_template()
else:
- return Entity.objects.base_entity().get_website.get_template()
+ return settings.CMS_TEMPLATES[0][0]
def get_contacts(self):

0 comments on commit e9dd276

Please sign in to comment.