Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
anand@sudhama.local committed Oct 10, 2007
1 parent 847be0f commit 1144b7b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
8 changes: 7 additions & 1 deletion infogami/core/dbupgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ def hash_passwords():
users = tdb.Things(parent=ctx.site, type=tuser).list()

for u in users:
preferences = u._c('preferences')
try:
preferences = u._c('preferences')
except:
# setup preferences for broken accounts, so that they can use forgot password.
preferences = db.new_version(u, 'preferences', db.get_type(ctx.site,'type/thing'), dict(password=''))
preferences.save()

if preferences.password:
auth.set_password(u, preferences.password)

Expand Down
1 change: 0 additions & 1 deletion infogami/core/thingutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ def primitive_value(type, value):

def default_value(type):
d = {
'type/int': 0,
'type/boolean': False
}
return d.get(type.name, '')
Expand Down
12 changes: 1 addition & 11 deletions infogami/utils/delegate.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ def delegate(path):

if path in pages:
out = getattr(pages[path](), method)(context.site)
elif path.startswith('files/'):
# quickfix
out = None
print view.get_static_resource(path)
else: # mode
normalized = _keyencode(path)
if path != normalized:
Expand Down Expand Up @@ -184,10 +180,4 @@ def _load():
for plugin in plugins:
template.load_templates(plugin.path)
macro.load_macros(plugin.path)
__import__(plugin.module + '.code', globals(), locals(), ['plugins'])

def pickdb(g):
"""Looks up the db type to use in config and exports its functions."""
instance = g[config.db_kind]()
for k in dir(instance):
g[k] = getattr(instance, k)
__import__(plugin.module + '.code', globals(), locals(), ['plugins'])

0 comments on commit 1144b7b

Please sign in to comment.