Example #1
0
def update_discourse_groups(self, pk):
    user = User.objects.get(pk=pk)
    logger.debug("Updating discourse groups for user %s" % user)
    try:
        DiscourseManager.update_groups(user)
    except:
        logger.warn("Discourse group sync failed for %s, retrying in 10 mins" % user)
        raise self.retry(countdown=60 * 10)
    logger.debug("Updated user %s discourse groups." % user)
Example #2
0
def update_discourse_groups(self, pk):
    user = User.objects.get(pk=pk)
    logger.debug("Updating discourse groups for user %s" % user)
    try:
        DiscourseManager.update_groups(user)
    except:
        logger.warn("Discourse group sync failed for %s, retrying in 10 mins" % user)
        raise self.retry(countdown=60 * 10)
    logger.debug("Updated user %s discourse groups." % user)
Example #3
0
def update_discourse_groups(pk):
    user = User.objects.get(pk=pk)
    logger.debug("Updating discourse groups for user %s" % user)
    authserviceinfo = AuthServicesInfo.objects.get(user=user)
    groups = []
    for group in user.groups.all():
        groups.append(str(group.name))
    if len(groups) == 0:
        logger.debug("No syncgroups found for user. Adding empty group.")
        groups.append('empty')
    logger.debug("Updating user %s discord groups to %s" % (user, groups))
    try:
        DiscourseManager.update_groups(authserviceinfo.discourse_username, groups)
    except:
        logger.warn("Discourse group sync failed for %s, retrying in 10 mins" % user, exc_info=True)
        raise self.retry(countdown = 60 * 10)
    logger.debug("Updated user %s discord groups." % user)
Example #4
0
def update_discourse_groups(pk):
    user = User.objects.get(pk=pk)
    logger.debug("Updating discourse groups for user %s" % user)
    authserviceinfo = AuthServicesInfo.objects.get(user=user)
    groups = []
    for group in user.groups.all():
        groups.append(str(group.name))
    if len(groups) == 0:
        logger.debug("No syncgroups found for user. Adding empty group.")
        groups.append('empty')
    logger.debug("Updating user %s discourse groups to %s" % (user, groups))
    try:
        DiscourseManager.update_groups(authserviceinfo.discourse_username, groups)
    except:
        logger.warn("Discourse group sync failed for %s, retrying in 10 mins" % user, exc_info=True)
        raise self.retry(countdown = 60 * 10)
    logger.debug("Updated user %s discourse groups." % user)