<commit_before>import React, { Component } from 'react'
import { connect } from 'react-redux'
import PropTypes from 'prop-types'

import emailApiClient from '../../api/email'
import styles from '../ListOfProjects/ListOfProjects.scss'

class Project extends Component {
  constructor (props) {
    super(props)

    this.handleClick = this.handleClick.bind(this)
    this.mailToOrganization = this.mailToOrganization.bind(this)
    this.renderProjectApplicationResult = this.renderProjectApplicationResult.bind(this)
    this.getAppliedStatus = this.getAppliedStatus.bind(this)
  }

  handleClick () {
    const applied = this.getAppliedStatus()
    if (this.props.authenticated && !applied) {
      return this.mailToOrganization(this.props.project)
    }<commit_msg>fix(project): only allow volunteers to apply to projects (#84)<commit_after>import React, { Component } from 'react'
import { connect } from 'react-redux'
import PropTypes from 'prop-types'

import emailApiClient from '../../api/email'
import styles from '../ListOfProjects/ListOfProjects.scss'

class Project extends Component {
  constructor (props) {
    super(props)

    this.handleClick = this.handleClick.bind(this)
    this.mailToOrganization = this.mailToOrganization.bind(this)
    this.renderProjectApplicationResult = this.renderProjectApplicationResult.bind(this)
    this.getAppliedStatus = this.getAppliedStatus.bind(this)
  }

  handleClick () {
    const { authenticated, user: { usertype } } = this.props
    const applied = this.getAppliedStatus()

    if (authenticated && usertype === 'volunteer' && !applied) {
      return this.mailToOrganization(this.props.project)
    }
{'fraction_non_alphanumeric': 0.1125150421179302, 'fraction_numerical': 0.0012033694344163659, 'mean_word_length': 4.381877022653722, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2220714', 'n_tokens_mistral': 491, 'n_tokens_neox': 472, 'n_words': 105}