<commit_before>getActiveRegistration = ->
  tournamentId = Session.get('active-tournament')._id
  userId = Session.get('active-user')._id
  registration = Registrants.findOne tournamentId: tournamentId, userId: userId

getTeamName = (teamId) ->
  for team in Session.get('active-tournament').teams
    if team.teamId is teamId
      return team.teamName

Template.registrantBadge.isASB = ->
  Session.get('active-tournament').tournamentName.indexOf('ASB') >= 0

Template.registrantBadge.isMale = ->
  Session.get('active-user').profile.gender is 'male'

Template.registrantBadge.photoFilename = ->
  photo = Session.get('active-user').profile.photoFilename
  if photo
    return allcourt.photoRoot
  else
    return ''

Template.registrantBadge.fullName = ->
  Session.get('active-user').profile.fullName

Template.registrantBadge.function = ->
  registration = getActiveRegistration()
  registration.function || getTeamName registration.teams[0]

Template.registrantBadge.accessCode = ->
  registration = getActiveRegistration()
  registration.accessCode
<commit_msg>Fixed photo bug<commit_after>getActiveRegistration = ->
  tournamentId = Session.get('active-tournament')._id
  userId = Session.get('active-user')._id
  registration = Registrants.findOne tournamentId: tournamentId, userId: userId

getTeamName = (teamId) ->
  for team in Session.get('active-tournament').teams
    if team.teamId is teamId
      return team.teamName

Template.registrantBadge.isASB = ->
  Session.get('active-tournament').tournamentName.indexOf('ASB') >= 0

Template.registrantBadge.isMale = ->
  Session.get('active-user').profile.gender is 'male'

Template.registrantBadge.photoFilename = ->
  photo = Session.get('active-user').profile.photoFilename
  if photo
    return allcourt.photoRoot + photo
  else
    return ''

Template.registrantBadge.fullName = ->
  Session.get('active-user').profile.fullName

Template.registrantBadge.function = ->
  registration = getActiveRegistration()
  registration.function || getTeamName registration.teams[0]

Template.registrantBadge.accessCode = ->
  registration = getActiveRegistration()
  registration.accessCode

{'fraction_non_alphanumeric': 0.11975768872320597, 'fraction_numerical': 0.001863932898415657, 'mean_word_length': 4.8501362397820165, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, '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': '2272630', 'n_tokens_mistral': 653, 'n_tokens_neox': 646, 'n_words': 105}