Commit 679f0130 by Hasnain

fix the "get_value_for_org" for str and list org.

parent 81ab0d81
......@@ -77,7 +77,11 @@ class SiteConfiguration(models.Model):
Configuration value for the given key.
"""
for configuration in cls.objects.filter(values__contains=org, enabled=True).all():
course_org_filter = configuration.get_value('course_org_filter', None)
course_org_filter = configuration.get_value('course_org_filter', [])
# The value of 'course_org_filter' can be configured as a string representing
# a single organization or a list of strings representing multiple organizations.
if not isinstance(course_org_filter, list):
course_org_filter = [course_org_filter]
if org in course_org_filter:
return configuration.get_value(name, default)
return default
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment