Retrieve a configuration setting for the current user, or return the default value specified by the caller.
(setting, default='')
| 74 | |
| 75 | |
| 76 | def get_setting(setting, default=''): |
| 77 | """Retrieve a configuration setting for the current user, or return the |
| 78 | default value specified by the caller.""" |
| 79 | data = Setting.query.filter_by( |
| 80 | user_id=current_user.id, setting=setting).first() |
| 81 | |
| 82 | if not data or data.value is None: |
| 83 | return default |
| 84 | else: |
| 85 | return data.value |
| 86 | |
| 87 | |
| 88 | def get_workspace_layout(): |
no test coverage detected