From a47bdc084a877b4bdbf8755e175f419955ac29fd Mon Sep 17 00:00:00 2001 From: phoenixeliot Date: Thu, 28 Jul 2016 15:14:43 -0700 Subject: [PATCH] Allow admins to become teachers --- app/core/Tracker.coffee | 1 + app/models/User.coffee | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/app/core/Tracker.coffee b/app/core/Tracker.coffee index 22af1dfa5..3a7d1f586 100644 --- a/app/core/Tracker.coffee +++ b/app/core/Tracker.coffee @@ -181,6 +181,7 @@ module.exports = class Tracker extends CocoClass ga? 'send', 'timing', category, variable, duration, label updateRole: -> + return if me.isAdmin() return unless me.isTeacher() return require('core/services/segment')() unless @segmentLoaded @identify() diff --git a/app/models/User.coffee b/app/models/User.coffee index d308c8ced..e53f25c62 100644 --- a/app/models/User.coffee +++ b/app/models/User.coffee @@ -92,7 +92,6 @@ module.exports = class User extends CocoModel Boolean((utils.getQueryVariable('dev', false) or me.isTeacher()) and utils.getQueryVariable('course', false)) setRole: (role, force=false) -> - return if me.isAdmin() oldRole = @get 'role' return if oldRole is role or (oldRole and not force) @set 'role', role