<commit_before>var mongoose = require('mongoose');
var passport = require('passport');
var _ = require('underscore');
var User = require('../models/User');
var Comment = require('../models/Comment');
var githubContributors = require('../components/GithubContributors');
var async = require('async');
var news = require('./news');
var markdownParser = require('../components/MarkdownParser');
var utils = require('../utils');


/**
 * GET /signup
 * Signup page.
 */

exports.getSignup = function(req, res) {
  if (req.user) return res.redirect('/');
  res.render('account/signup', {
    title: 'Create Account'
  });
};

/**
 * GET /account
 * Profile page.
 */

exports.getAccount = function(req, res) {
  console.log (res.locals.user);
  res.render('account/profile', {
    title: 'Account Management'
  });
};

/**
 * POST /account/profile
 * Update profile information.
 */

exports.postUpdateProfile = function(req, res, next) {
  User.findById(req.user.id, function(err, user) {
    if (err) return next(err);
    user.email = req.body.email || '';
    user.profile.name = req.body.name || '';
    user.profile.location = req.body.location || '';
    user.profile.bio = req.body.bio || '';

    if(req.body.description.length < 32){  
        user.profile.description = req.body.description || '';
    }

    if (req.body.website.match(/https?:\/\//i)) {
      user.profile.website = req.body.website;
    } else if (user.profile.website) {<commit_msg>Hotfix for user settings<commit_after>var mongoose = require('mongoose');
var passport = require('passport');
var _ = require('underscore');
var User = require('../models/User');
var Comment = require('../models/Comment');
var githubContributors = require('../components/GithubContributors');
var async = require('async');
var news = require('./news');
var markdownParser = require('../components/MarkdownParser');
var utils = require('../utils');


/**
 * GET /signup
 * Signup page.
 */

exports.getSignup = function(req, res) {
  if (req.user) return res.redirect('/');
  res.render('account/signup', {
    title: 'Create Account'
  });
};

/**
 * GET /account
 * Profile page.
 */

exports.getAccount = function(req, res) {
  console.log (res.locals.user);
  res.render('account/settings', {
    title: 'Account Management'
  });
};

/**
 * POST /account/profile
 * Update profile information.
 */

exports.postUpdateProfile = function(req, res, next) {
  User.findById(req.user.id, function(err, user) {
    if (err) return next(err);
    user.email = req.body.email || '';
    user.profile.name = req.body.name || '';
    user.profile.location = req.body.location || '';
    user.profile.bio = req.body.bio || '';

    if(req.body.description.length < 32){  
        user.profile.description = req.body.description || '';
    }

    if (req.body.website.match(/https?:\/\//i)) {
      user.profile.website = req.body.website;
    } else if (user.profile.website) {
{'fraction_non_alphanumeric': 0.1885245901639344, 'fraction_numerical': 0.001366120218579235, 'mean_word_length': 3.451367781155015, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7616571', 'n_tokens_mistral': 943, 'n_tokens_neox': 918, 'n_words': 187}