<commit_before>from datetime import datetime

from django.contrib.auth.models import User
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models.signals import m2m_changed, pre_save
from django.dispatch import receiver
from django.utils.timezone import utc

import caching.base

from remo.dashboard.models import ActionItem, Item


ADD_RECEIPTS_ACTION = 'Add receipts for'
ADD_REPORT_ACTION = 'Add report for'
ADD_PHOTOS_ACTION = 'Add photos for'
ADD_REPORTS_PHOTOS_ACTION = 'Add reports/photos for'
REVIEW_BUDGET_REQUEST_ACTION = 'Review budget request'
WAITING_MENTOR_VALIDATION_ACTION = 'Waiting mentor validation for'
NEEDINFO_ACTION = 'Need info for'


class Bug(caching.base.CachingMixin, models.Model):
    """Bug model definition."""
    created_on = models.DateTimeField(auto_now_add=True)
    updated_on = models.DateTimeField(auto_now=True)
    bug_id = models.PositiveIntegerField(unique=True)
    bug_creation_time = models.DateTimeField(blank=True, null=True)
    bug_last_change_time = models.DateTimeField(blank=True, null=True)
    creator = models.ForeignKey(User, null=True, blank=True,
                                related_name='bugs_created',
                                on_delete=models.SET_NULL)
    assigned_to = models.ForeignKey(User, null=True, blank=True,
                                    related_name='bugs_assigned',
                                    on_delete=models.SET_NULL)
    cc = models.ManyToManyField(User, related_name='bugs_cced')
    component = models.CharField(max_length=200)
    summary = models.CharField(max_length=500, default='')
    whiteboard = models.CharField(max_length=500, default='')
    status = models.CharField(max_length=30, default='')
    resolution = models.CharField(max_length=30, default='')
    first_comment = models.TextField(default='', blank=True)
    council_vote_requested = models.BooleanField(default=False)
    council_member_assigned = models.BooleanField(default=False)<commit_msg>[fix bug 1097630] Make strings in action items unicode.<commit_after>from datetime import datetime

from django.contrib.auth.models import User
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models.signals import m2m_changed, pre_save
from django.dispatch import receiver
from django.utils.timezone import utc

import caching.base

from remo.dashboard.models import ActionItem, Item


ADD_RECEIPTS_ACTION = u'Add receipts for'
ADD_REPORT_ACTION = u'Add report for'
ADD_PHOTOS_ACTION = u'Add photos for'
ADD_REPORTS_PHOTOS_ACTION = u'Add reports/photos for'
REVIEW_BUDGET_REQUEST_ACTION = u'Review budget request'
WAITING_MENTOR_VALIDATION_ACTION = u'Waiting mentor validation for'
NEEDINFO_ACTION = u'Need info for'


class Bug(caching.base.CachingMixin, models.Model):
    """Bug model definition."""
    created_on = models.DateTimeField(auto_now_add=True)
    updated_on = models.DateTimeField(auto_now=True)
    bug_id = models.PositiveIntegerField(unique=True)
    bug_creation_time = models.DateTimeField(blank=True, null=True)
    bug_last_change_time = models.DateTimeField(blank=True, null=True)
    creator = models.ForeignKey(User, null=True, blank=True,
                                related_name='bugs_created',
                                on_delete=models.SET_NULL)
    assigned_to = models.ForeignKey(User, null=True, blank=True,
                                    related_name='bugs_assigned',
                                    on_delete=models.SET_NULL)
    cc = models.ManyToManyField(User, related_name='bugs_cced')
    component = models.CharField(max_length=200)
    summary = models.CharField(max_length=500, default='')
    whiteboard = models.CharField(max_length=500, default='')
    status = models.CharField(max_length=30, default='')
    resolution = models.CharField(max_length=30, default='')
    first_comment = models.TextField(default='', blank=True)
    council_vote_requested = models.BooleanField(default=False)
    council_member_assigned = models.BooleanField(default=False)
{'fraction_non_alphanumeric': 0.0892644608426565, 'fraction_numerical': 0.008331349678647942, 'mean_word_length': 4.22636815920398, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6167204', 'n_tokens_mistral': 1270, 'n_tokens_neox': 1221, 'n_words': 253}