<commit_before>from django.contrib.sites.models import Site
from django.contrib.gis.db import models as geomodel
from django.db import models
from django.conf import settings
from django.core.mail import send_mail
from django.contrib.sites.managers import CurrentSiteManager

class Feedback(models.Model):
    """
    This model includes all the feedback
    given for the softGIS django application.

    When a feedback is saved it sends an email
    to the administrators as set in settings.py.

    >>> import settings
    >>> from softgis.models import Feedback
    >>> from django.core import mail
    >>> fb = Feedback(content='some feedback',site=1)
    >>> fb.save()
    >>> mail.outbox[0].body
    'some feedback'
    """
    site = models.ForeignKey(Site)
    content = models.TextField(blank=True)
    create_time = models.DateTimeField(auto_now_add=True)


    def save(self, *args, **kwargs):
        if self.content != "":
            send_mail('Feedback for the softGIS application',
                    self.content,
                    '<EMAIL>',
                    [admin[1] for admin in settings.ADMINS],
                    fail_silently=True)

            super(Feedback, self).save(*args, **kwargs)
        else:
            pass

    def __unicode__(self):
        return u"feedback " + str(self.create_time)


class CitySetting(models.Model):
    site = models.ForeignKey(Site,
                             unique = True,
                             default = getattr(settings, 'SITE_ID', 1),
                             editable = False)
    city_name = models.CharField(max_length=30,
                                 default='City')
    background_color = models.CharField(max_length=7,
                                        default='#e8ae6a')
    text_color = models.CharField(max_length=7,
                                  default='#e8ae6a')
    title = models.CharField(max_length=50,
                             default = 'test page')
    blurb = models.CharField(max_length=50,
                             default='Help us improve our City')
    provider = models.CharField(max_length=30,
                                default='Geonition')
    provider_url = models.URLField()
    city_area = geomodel.PolygonField(srid = getattr(settings, 'SPATIAL_REFERENCE_SYSTEM_ID', 4326))
    on_site = CurrentSiteManager()
    analytics_script = models.TextField()


    def __unicode__(self):<commit_msg>made the analytics script blank True to not confuse users too much<commit_after>from django.contrib.sites.models import Site
from django.contrib.gis.db import models as geomodel
from django.db import models
from django.conf import settings
from django.core.mail import send_mail
from django.contrib.sites.managers import CurrentSiteManager

class Feedback(models.Model):
    """
    This model includes all the feedback
    given for the softGIS django application.

    When a feedback is saved it sends an email
    to the administrators as set in settings.py.

    >>> import settings
    >>> from softgis.models import Feedback
    >>> from django.core import mail
    >>> fb = Feedback(content='some feedback',site=1)
    >>> fb.save()
    >>> mail.outbox[0].body
    'some feedback'
    """
    site = models.ForeignKey(Site)
    content = models.TextField(blank=True)
    create_time = models.DateTimeField(auto_now_add=True)


    def save(self, *args, **kwargs):
        if self.content != "":
            send_mail('Feedback for the softGIS application',
                    self.content,
                    '<EMAIL>',
                    [admin[1] for admin in settings.ADMINS],
                    fail_silently=True)

            super(Feedback, self).save(*args, **kwargs)
        else:
            pass

    def __unicode__(self):
        return u"feedback " + str(self.create_time)


class CitySetting(models.Model):
    site = models.ForeignKey(Site,
                             unique = True,
                             default = getattr(settings, 'SITE_ID', 1),
                             editable = False)
    city_name = models.CharField(max_length=30,
                                 default='City')
    background_color = models.CharField(max_length=7,
                                        default='#e8ae6a')
    text_color = models.CharField(max_length=7,
                                  default='#e8ae6a')
    title = models.CharField(max_length=50,
                             default = 'test page')
    blurb = models.CharField(max_length=50,
                             default='Help us improve our City')
    provider = models.CharField(max_length=30,
                                default='Geonition')
    provider_url = models.URLField()
    city_area = geomodel.PolygonField(srid = getattr(settings, 'SPATIAL_REFERENCE_SYSTEM_ID', 4326))
    on_site = CurrentSiteManager()
    analytics_script = models.TextField(blank = True)


    def __unicode__(self):
{'fraction_non_alphanumeric': 0.09492005666869055, 'fraction_numerical': 0.008905079943331309, 'mean_word_length': 2.1238938053097347, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2804812', 'n_tokens_mistral': 1383, 'n_tokens_neox': 1311, 'n_words': 325}