Allow MetadataLookup to receive callables. Update the {{ users }} and {{ groups }} metadata lookup options to be callables that return a current list of users and groups and not a queryset. Add integrations test user_managements -> metadata app. Fixes GitLab #290. Thanks to @camiloforero for finding this one.

This commit is contained in:
Roberto Rosario
2016-05-19 19:33:58 -04:00
parent 4de3bb99e2
commit d1c87fe102
3 changed files with 79 additions and 4 deletions

View File

@@ -29,7 +29,10 @@ class MetadataLookup(object):
def get_as_context(cls):
result = {}
for entry in cls._registry:
result[entry.name] = entry.value
try:
result[entry.name] = entry.value()
except TypeError:
result[entry.name] = entry.value
return result