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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user