We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Minor issues in feedback
- We have said that rating questions go up to 5, they actually go to 6. This must be either changed, or the committees must be informed so questions can be altered.
- Norwegian dates in the mail sent to users
- The domain used for the links should be https://online.ntnu.no, not morgan.online.ntnu.no
- Online linjeforening should be Linjeforeningen Online
- Errors on required fields should stand out more, see appendix 1 for current.

"Hei, vi ønsker tilbakemelding på "Kurs med Steria" som du var med på den 23. January:

morgan.online.ntnu.no/feedback/events/event/23/2/

Fristen for å svare på skjema er 30. January innen kl 23:59.
Vær oppmerksom på at du får prikk dersom du ikke svarer på disse spørsmålene innen fristen.

Eventuelle spørsmål sendes til fagkom@online.ntnu.no

Mvh
Online linjeforening"

Appendix 1
![required field](https://f.cloud.github.com/assets/632466/1994553/9b936e4e-84f0-11e3-9deb-e1a8bc3892dd.png)


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `apps/feedback/mommy.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 import datetime
3 import socket
4 
5 from django.utils import timezone
6 from django.contrib.contenttypes.models import ContentType
7 from django.conf import settings
8 from django.core.mail import EmailMessage
9 
10 from apps.events.models import Event, AttendanceEvent, Attendee
11 from apps.feedback.models import FeedbackRelation
12 from apps.marks.models import Mark, UserEntry
13 from apps.mommy import Task, schedule
14 
15 class FeedbackMail(Task):
16 
17     @staticmethod
18     def run():
19        active_feedbacks = FeedbackRelation.objects.filter(active=True)
20        
21        for feedback in active_feedbacks:
22             message = FeedbackMail.generate_message(feedback)
23 
24             if message.send:
25                 EmailMessage(message.subject, unicode(message), message.committee_mail, [], message.attended_mails).send()
26 
27                 if message.results_message:
28                     EmailMessage("Feedback resultat", message.results_message,"online@online.ntnu.no", [message.committee_mail]).send() 
29 
30     @staticmethod
31     def generate_message(feedback):
32         today = timezone.now().date()
33         yesterday = today + datetime.timedelta(days=-1)
34         not_responded = FeedbackMail.get_users(feedback)
35         message = Message()
36 
37         #return if everyone has answered
38         if not not_responded:
39             return message
40         
41         message.attended_mails = FeedbackMail.get_user_mails(not_responded)
42 
43         message.committee_mail = FeedbackMail.get_committee_email(feedback)
44         deadline = feedback.deadline.strftime("%d. %B").encode("utf-8")
45         title = str(FeedbackMail.get_title(feedback)).encode("utf-8")
46         message.link = str(u"\n\n" + FeedbackMail.get_link(feedback)).encode("utf-8")
47         results_link = str(FeedbackMail.get_link(feedback) + "results").encode("utf-8")
48        
49         start_date = feedback.get_start_date()
50         deadline_diff = (feedback.deadline - today).days
51 
52         message.subject = u"Feedback: %s" % (title)
53         message.intro = u"Hei, vi ønsker tilbakemelding på \"%s\"" % (title)
54         message.mark = FeedbackMail.mark_message(feedback)
55         message.contact = u"\n\nEventuelle spørsmål sendes til %s " % (message.committee_mail)
56         message.start_date = FeedbackMail.start_date_message(start_date)
57 
58         if deadline_diff < 0: #Deadline passed
59             feedback.active = False
60             feedback.save()
61 
62             if feedback.gives_mark:
63                 FeedbackMail.set_marks(title, not_responded)    
64                 
65                 message.intro = u"Fristen for å svare på \"%s\" har gått ut og du har fått en prikk." % (title)
66                 message.mark = ""
67                 message.start_date = ""
68                 message.link = ""
69                 message.send = True
70 
71         elif deadline_diff < 1: #Last warning
72             message.deadline = u"\n\nI dag innen 23:59 er siste frist til å svare på skjemaet."
73             
74             message.results_message = u"Hei, siste purremail på feedback skjema har blitt sendt til alle " \
75             u"gjenværende deltagere på \"%s\".\nDere kan se feedback-resultatene på:\n%s\n" % \
76             (title, results_link)
77             message.send = True
78         elif deadline_diff < 3 and feedback.gives_mark: # 3 days from the deadline
79             message.deadline = u"\n\nFristen for å svare på skjema er %s innen kl 23:59." % (deadline)
80             message.send = True
81         elif FeedbackMail.send_first_notification(feedback): #Day after the event or feedback creation 
82             message.deadline = u"\n\nFristen for å svare på skjema er %s innen kl 23:59." % (deadline)
83         
84             message.results_message = u"Hei, nå har feedbackmail blitt sendt til alle " \
85             u"deltagere på \"%s\".\nDere kan se feedback-resultatene på:\n%s\n" % \
86             (title, results_link)
87             message.send = True
88 
89         return message
90         
91     @staticmethod
92     def send_first_notification(feedback):
93         start_date = FeedbackMail.start_date(feedback)
94 
95         #The object that requires feedback doesnt have a start date
96         if not start_date:
97             yesterday = timezone.now().date() - datetime.timedelta(days=1)
98             if feedback.created_date == yesterday.date():
99                 #Send the first notification the day after the feedback relation was created
100                 return True
101         else:
102             day_after_event = start_date + datetime.timedelta(1)
103             if day_after_event == datetime.datetime.date(timezone.now()):
104                 #Send the first notification the day after the event
105                 return True
106         return False
107 
108     @staticmethod
109     def start_date(feedback):
110         start_date = feedback.get_start_date()
111         
112         if start_date:
113             return start_date.date()
114         else:
115             return False
116 
117     @staticmethod
118     def start_date_message(start_date):
119         #If the object(event) doesnt have start date it will send 
120         #the first notification the day after the feedbackrelation is made
121         if start_date:
122             start_date_string = start_date.strftime("%d. %B").encode("utf-8")
123             message_start_date = u"som du var med på den %s:" % (start_date_string)
124         else:
125             message_start_date = ""
126         
127         return message_start_date   
128 
129     @staticmethod
130     def get_users(feedback):
131         return feedback.get_slackers()
132 
133     @staticmethod
134     def get_user_mails(not_responded):
135         return  [user.email for user in not_responded]
136 
137     @staticmethod
138     def get_link(feedback):
139         hostname = socket.getfqdn()
140         return str(hostname + feedback.get_absolute_url())
141 
142     @staticmethod
143     def get_title(feedback):
144         return feedback.get_title()
145 
146     @staticmethod
147     def get_committee_email(feedback):
148         return feedback.get_email()
149 
150     @staticmethod
151     def mark_message(feedback):
152         if feedback.gives_mark:
153             return u"\nVær oppmerksom på at du får prikk dersom du ikke svarer " \
154             u"på disse spørsmålene innen fristen."
155         else:
156             return ""
157 
158     @staticmethod
159     def set_marks(title, not_responded):
160         mark = Mark()
161         mark.title = u"Manglende tilbakemelding på %s" % (title)
162         mark.category = 4 #Missed feedback
163         mark.description = u"Du har fått en prikk fordi du ikke har levert tilbakemelding."
164         mark.save()
165         
166         for user in not_responded:
167             user_entry = UserEntry()
168             user_entry.user = user
169             user_entry.mark = mark
170             user_entry.save()
171     
172 class Message():
173     subject = ""
174     intro = ""
175     start_date = ""
176     deadline = ""
177     mark = ""
178     contact = ""
179     link = ""
180     send = False
181     end = u"\n\nMvh\nOnline linjeforening"
182     results_message = False
183 
184     committee_mail = ""
185     attended_mails = False
186 
187 
188     def __unicode__(self):
189         message = "%s %s %s %s %s %s %s" % (
190             self.intro, 
191             self.start_date, 
192             self.link, 
193             self.deadline, 
194             self.mark, 
195             self.contact, 
196             self.end)
197         return message
198 
199 schedule.register(FeedbackMail, day_of_week='mon-sun', hour=8, minute=0)
200
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/apps/feedback/mommy.py b/apps/feedback/mommy.py
--- a/apps/feedback/mommy.py
+++ b/apps/feedback/mommy.py
@@ -1,6 +1,7 @@
 # -*- coding: utf-8 -*-
 import datetime
 import socket
+import locale
 
 from django.utils import timezone
 from django.contrib.contenttypes.models import ContentType
@@ -16,9 +17,10 @@
 
     @staticmethod
     def run():
-       active_feedbacks = FeedbackRelation.objects.filter(active=True)
+        locale.setlocale(locale.LC_ALL, "nb_NO.UTF-8")
+        active_feedbacks = FeedbackRelation.objects.filter(active=True)
        
-       for feedback in active_feedbacks:
+        for feedback in active_feedbacks:
             message = FeedbackMail.generate_message(feedback)
 
             if message.send:
@@ -178,7 +180,7 @@
     contact = ""
     link = ""
     send = False
-    end = u"\n\nMvh\nOnline linjeforening"
+    end = u"\n\nMvh\nLinjeforeningen Online"
     results_message = False
 
     committee_mail = ""
@@ -196,4 +198,4 @@
             self.end)
         return message
 
-schedule.register(FeedbackMail, day_of_week='mon-sun', hour=8, minute=0)
+schedule.register(FeedbackMail, day_of_week='mon-sun', hour=8, minute=00)

{"golden_diff": "diff --git a/apps/feedback/mommy.py b/apps/feedback/mommy.py\n--- a/apps/feedback/mommy.py\n+++ b/apps/feedback/mommy.py\n@@ -1,6 +1,7 @@\n # -*- coding: utf-8 -*-\n import datetime\n import socket\n+import locale\n \n from django.utils import timezone\n from django.contrib.contenttypes.models import ContentType\n@@ -16,9 +17,10 @@\n \n     @staticmethod\n     def run():\n-       active_feedbacks = FeedbackRelation.objects.filter(active=True)\n+        locale.setlocale(locale.LC_ALL, \"nb_NO.UTF-8\")\n+        active_feedbacks = FeedbackRelation.objects.filter(active=True)\n        \n-       for feedback in active_feedbacks:\n+        for feedback in active_feedbacks:\n             message = FeedbackMail.generate_message(feedback)\n \n             if message.send:\n@@ -178,7 +180,7 @@\n     contact = \"\"\n     link = \"\"\n     send = False\n-    end = u\"\\n\\nMvh\\nOnline linjeforening\"\n+    end = u\"\\n\\nMvh\\nLinjeforeningen Online\"\n     results_message = False\n \n     committee_mail = \"\"\n@@ -196,4 +198,4 @@\n             self.end)\n         return message\n \n-schedule.register(FeedbackMail, day_of_week='mon-sun', hour=8, minute=0)\n+schedule.register(FeedbackMail, day_of_week='mon-sun', hour=8, minute=00)\n", "issue": "Minor issues in feedback\n- We have said that rating questions go up to 5, they actually go to 6. This must be either changed, or the committees must be informed so questions can be altered.\n- Norwegian dates in the mail sent to users\n- The domain used for the links should be https://online.ntnu.no, not morgan.online.ntnu.no\n- Online linjeforening should be Linjeforeningen Online\n- Errors on required fields should stand out more, see appendix 1 for current.\n\n\"Hei, vi \u00f8nsker tilbakemelding p\u00e5 \"Kurs med Steria\" som du var med p\u00e5 den 23. January:\n\nmorgan.online.ntnu.no/feedback/events/event/23/2/\n\nFristen for \u00e5 svare p\u00e5 skjema er 30. January innen kl 23:59.\nV\u00e6r oppmerksom p\u00e5 at du f\u00e5r prikk dersom du ikke svarer p\u00e5 disse sp\u00f8rsm\u00e5lene innen fristen.\n\nEventuelle sp\u00f8rsm\u00e5l sendes til fagkom@online.ntnu.no\n\nMvh\nOnline linjeforening\"\n\nAppendix 1\n![required field](https://f.cloud.github.com/assets/632466/1994553/9b936e4e-84f0-11e3-9deb-e1a8bc3892dd.png)\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\nimport datetime\nimport socket\n\nfrom django.utils import timezone\nfrom django.contrib.contenttypes.models import ContentType\nfrom django.conf import settings\nfrom django.core.mail import EmailMessage\n\nfrom apps.events.models import Event, AttendanceEvent, Attendee\nfrom apps.feedback.models import FeedbackRelation\nfrom apps.marks.models import Mark, UserEntry\nfrom apps.mommy import Task, schedule\n\nclass FeedbackMail(Task):\n\n    @staticmethod\n    def run():\n       active_feedbacks = FeedbackRelation.objects.filter(active=True)\n       \n       for feedback in active_feedbacks:\n            message = FeedbackMail.generate_message(feedback)\n\n            if message.send:\n                EmailMessage(message.subject, unicode(message), message.committee_mail, [], message.attended_mails).send()\n\n                if message.results_message:\n                    EmailMessage(\"Feedback resultat\", message.results_message,\"online@online.ntnu.no\", [message.committee_mail]).send() \n\n    @staticmethod\n    def generate_message(feedback):\n        today = timezone.now().date()\n        yesterday = today + datetime.timedelta(days=-1)\n        not_responded = FeedbackMail.get_users(feedback)\n        message = Message()\n\n        #return if everyone has answered\n        if not not_responded:\n            return message\n        \n        message.attended_mails = FeedbackMail.get_user_mails(not_responded)\n\n        message.committee_mail = FeedbackMail.get_committee_email(feedback)\n        deadline = feedback.deadline.strftime(\"%d. %B\").encode(\"utf-8\")\n        title = str(FeedbackMail.get_title(feedback)).encode(\"utf-8\")\n        message.link = str(u\"\\n\\n\" + FeedbackMail.get_link(feedback)).encode(\"utf-8\")\n        results_link = str(FeedbackMail.get_link(feedback) + \"results\").encode(\"utf-8\")\n       \n        start_date = feedback.get_start_date()\n        deadline_diff = (feedback.deadline - today).days\n\n        message.subject = u\"Feedback: %s\" % (title)\n        message.intro = u\"Hei, vi \u00f8nsker tilbakemelding p\u00e5 \\\"%s\\\"\" % (title)\n        message.mark = FeedbackMail.mark_message(feedback)\n        message.contact = u\"\\n\\nEventuelle sp\u00f8rsm\u00e5l sendes til %s \" % (message.committee_mail)\n        message.start_date = FeedbackMail.start_date_message(start_date)\n\n        if deadline_diff < 0: #Deadline passed\n            feedback.active = False\n            feedback.save()\n\n            if feedback.gives_mark:\n                FeedbackMail.set_marks(title, not_responded)    \n                \n                message.intro = u\"Fristen for \u00e5 svare p\u00e5 \\\"%s\\\" har g\u00e5tt ut og du har f\u00e5tt en prikk.\" % (title)\n                message.mark = \"\"\n                message.start_date = \"\"\n                message.link = \"\"\n                message.send = True\n\n        elif deadline_diff < 1: #Last warning\n            message.deadline = u\"\\n\\nI dag innen 23:59 er siste frist til \u00e5 svare p\u00e5 skjemaet.\"\n            \n            message.results_message = u\"Hei, siste purremail p\u00e5 feedback skjema har blitt sendt til alle \" \\\n            u\"gjenv\u00e6rende deltagere p\u00e5 \\\"%s\\\".\\nDere kan se feedback-resultatene p\u00e5:\\n%s\\n\" % \\\n            (title, results_link)\n            message.send = True\n        elif deadline_diff < 3 and feedback.gives_mark: # 3 days from the deadline\n            message.deadline = u\"\\n\\nFristen for \u00e5 svare p\u00e5 skjema er %s innen kl 23:59.\" % (deadline)\n            message.send = True\n        elif FeedbackMail.send_first_notification(feedback): #Day after the event or feedback creation \n            message.deadline = u\"\\n\\nFristen for \u00e5 svare p\u00e5 skjema er %s innen kl 23:59.\" % (deadline)\n        \n            message.results_message = u\"Hei, n\u00e5 har feedbackmail blitt sendt til alle \" \\\n            u\"deltagere p\u00e5 \\\"%s\\\".\\nDere kan se feedback-resultatene p\u00e5:\\n%s\\n\" % \\\n            (title, results_link)\n            message.send = True\n\n        return message\n        \n    @staticmethod\n    def send_first_notification(feedback):\n        start_date = FeedbackMail.start_date(feedback)\n\n        #The object that requires feedback doesnt have a start date\n        if not start_date:\n            yesterday = timezone.now().date() - datetime.timedelta(days=1)\n            if feedback.created_date == yesterday.date():\n                #Send the first notification the day after the feedback relation was created\n                return True\n        else:\n            day_after_event = start_date + datetime.timedelta(1)\n            if day_after_event == datetime.datetime.date(timezone.now()):\n                #Send the first notification the day after the event\n                return True\n        return False\n\n    @staticmethod\n    def start_date(feedback):\n        start_date = feedback.get_start_date()\n        \n        if start_date:\n            return start_date.date()\n        else:\n            return False\n\n    @staticmethod\n    def start_date_message(start_date):\n        #If the object(event) doesnt have start date it will send \n        #the first notification the day after the feedbackrelation is made\n        if start_date:\n            start_date_string = start_date.strftime(\"%d. %B\").encode(\"utf-8\")\n            message_start_date = u\"som du var med p\u00e5 den %s:\" % (start_date_string)\n        else:\n            message_start_date = \"\"\n        \n        return message_start_date   \n\n    @staticmethod\n    def get_users(feedback):\n        return feedback.get_slackers()\n\n    @staticmethod\n    def get_user_mails(not_responded):\n        return  [user.email for user in not_responded]\n\n    @staticmethod\n    def get_link(feedback):\n        hostname = socket.getfqdn()\n        return str(hostname + feedback.get_absolute_url())\n\n    @staticmethod\n    def get_title(feedback):\n        return feedback.get_title()\n\n    @staticmethod\n    def get_committee_email(feedback):\n        return feedback.get_email()\n\n    @staticmethod\n    def mark_message(feedback):\n        if feedback.gives_mark:\n            return u\"\\nV\u00e6r oppmerksom p\u00e5 at du f\u00e5r prikk dersom du ikke svarer \" \\\n            u\"p\u00e5 disse sp\u00f8rsm\u00e5lene innen fristen.\"\n        else:\n            return \"\"\n\n    @staticmethod\n    def set_marks(title, not_responded):\n        mark = Mark()\n        mark.title = u\"Manglende tilbakemelding p\u00e5 %s\" % (title)\n        mark.category = 4 #Missed feedback\n        mark.description = u\"Du har f\u00e5tt en prikk fordi du ikke har levert tilbakemelding.\"\n        mark.save()\n        \n        for user in not_responded:\n            user_entry = UserEntry()\n            user_entry.user = user\n            user_entry.mark = mark\n            user_entry.save()\n    \nclass Message():\n    subject = \"\"\n    intro = \"\"\n    start_date = \"\"\n    deadline = \"\"\n    mark = \"\"\n    contact = \"\"\n    link = \"\"\n    send = False\n    end = u\"\\n\\nMvh\\nOnline linjeforening\"\n    results_message = False\n\n    committee_mail = \"\"\n    attended_mails = False\n\n\n    def __unicode__(self):\n        message = \"%s %s %s %s %s %s %s\" % (\n            self.intro, \n            self.start_date, \n            self.link, \n            self.deadline, \n            self.mark, \n            self.contact, \n            self.end)\n        return message\n\nschedule.register(FeedbackMail, day_of_week='mon-sun', hour=8, minute=0)\n", "path": "apps/feedback/mommy.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\nimport datetime\nimport socket\nimport locale\n\nfrom django.utils import timezone\nfrom django.contrib.contenttypes.models import ContentType\nfrom django.conf import settings\nfrom django.core.mail import EmailMessage\n\nfrom apps.events.models import Event, AttendanceEvent, Attendee\nfrom apps.feedback.models import FeedbackRelation\nfrom apps.marks.models import Mark, UserEntry\nfrom apps.mommy import Task, schedule\n\nclass FeedbackMail(Task):\n\n    @staticmethod\n    def run():\n        locale.setlocale(locale.LC_ALL, \"nb_NO.UTF-8\")\n        active_feedbacks = FeedbackRelation.objects.filter(active=True)\n       \n        for feedback in active_feedbacks:\n            message = FeedbackMail.generate_message(feedback)\n\n            if message.send:\n                EmailMessage(message.subject, unicode(message), message.committee_mail, [], message.attended_mails).send()\n\n                if message.results_message:\n                    EmailMessage(\"Feedback resultat\", message.results_message,\"online@online.ntnu.no\", [message.committee_mail]).send() \n\n    @staticmethod\n    def generate_message(feedback):\n        today = timezone.now().date()\n        yesterday = today + datetime.timedelta(days=-1)\n        not_responded = FeedbackMail.get_users(feedback)\n        message = Message()\n\n        #return if everyone has answered\n        if not not_responded:\n            return message\n        \n        message.attended_mails = FeedbackMail.get_user_mails(not_responded)\n\n        message.committee_mail = FeedbackMail.get_committee_email(feedback)\n        deadline = feedback.deadline.strftime(\"%d. %B\").encode(\"utf-8\")\n        title = str(FeedbackMail.get_title(feedback)).encode(\"utf-8\")\n        message.link = str(u\"\\n\\n\" + FeedbackMail.get_link(feedback)).encode(\"utf-8\")\n        results_link = str(FeedbackMail.get_link(feedback) + \"results\").encode(\"utf-8\")\n       \n        start_date = feedback.get_start_date()\n        deadline_diff = (feedback.deadline - today).days\n\n        message.subject = u\"Feedback: %s\" % (title)\n        message.intro = u\"Hei, vi \u00f8nsker tilbakemelding p\u00e5 \\\"%s\\\"\" % (title)\n        message.mark = FeedbackMail.mark_message(feedback)\n        message.contact = u\"\\n\\nEventuelle sp\u00f8rsm\u00e5l sendes til %s \" % (message.committee_mail)\n        message.start_date = FeedbackMail.start_date_message(start_date)\n\n        if deadline_diff < 0: #Deadline passed\n            feedback.active = False\n            feedback.save()\n\n            if feedback.gives_mark:\n                FeedbackMail.set_marks(title, not_responded)    \n                \n                message.intro = u\"Fristen for \u00e5 svare p\u00e5 \\\"%s\\\" har g\u00e5tt ut og du har f\u00e5tt en prikk.\" % (title)\n                message.mark = \"\"\n                message.start_date = \"\"\n                message.link = \"\"\n                message.send = True\n\n        elif deadline_diff < 1: #Last warning\n            message.deadline = u\"\\n\\nI dag innen 23:59 er siste frist til \u00e5 svare p\u00e5 skjemaet.\"\n            \n            message.results_message = u\"Hei, siste purremail p\u00e5 feedback skjema har blitt sendt til alle \" \\\n            u\"gjenv\u00e6rende deltagere p\u00e5 \\\"%s\\\".\\nDere kan se feedback-resultatene p\u00e5:\\n%s\\n\" % \\\n            (title, results_link)\n            message.send = True\n        elif deadline_diff < 3 and feedback.gives_mark: # 3 days from the deadline\n            message.deadline = u\"\\n\\nFristen for \u00e5 svare p\u00e5 skjema er %s innen kl 23:59.\" % (deadline)\n            message.send = True\n        elif FeedbackMail.send_first_notification(feedback): #Day after the event or feedback creation \n            message.deadline = u\"\\n\\nFristen for \u00e5 svare p\u00e5 skjema er %s innen kl 23:59.\" % (deadline)\n        \n            message.results_message = u\"Hei, n\u00e5 har feedbackmail blitt sendt til alle \" \\\n            u\"deltagere p\u00e5 \\\"%s\\\".\\nDere kan se feedback-resultatene p\u00e5:\\n%s\\n\" % \\\n            (title, results_link)\n            message.send = True\n\n        return message\n        \n    @staticmethod\n    def send_first_notification(feedback):\n        start_date = FeedbackMail.start_date(feedback)\n\n        #The object that requires feedback doesnt have a start date\n        if not start_date:\n            yesterday = timezone.now().date() - datetime.timedelta(days=1)\n            if feedback.created_date == yesterday.date():\n                #Send the first notification the day after the feedback relation was created\n                return True\n        else:\n            day_after_event = start_date + datetime.timedelta(1)\n            if day_after_event == datetime.datetime.date(timezone.now()):\n                #Send the first notification the day after the event\n                return True\n        return False\n\n    @staticmethod\n    def start_date(feedback):\n        start_date = feedback.get_start_date()\n        \n        if start_date:\n            return start_date.date()\n        else:\n            return False\n\n    @staticmethod\n    def start_date_message(start_date):\n        #If the object(event) doesnt have start date it will send \n        #the first notification the day after the feedbackrelation is made\n        if start_date:\n            start_date_string = start_date.strftime(\"%d. %B\").encode(\"utf-8\")\n            message_start_date = u\"som du var med p\u00e5 den %s:\" % (start_date_string)\n        else:\n            message_start_date = \"\"\n        \n        return message_start_date   \n\n    @staticmethod\n    def get_users(feedback):\n        return feedback.get_slackers()\n\n    @staticmethod\n    def get_user_mails(not_responded):\n        return  [user.email for user in not_responded]\n\n    @staticmethod\n    def get_link(feedback):\n        hostname = socket.getfqdn()\n        return str(hostname + feedback.get_absolute_url())\n\n    @staticmethod\n    def get_title(feedback):\n        return feedback.get_title()\n\n    @staticmethod\n    def get_committee_email(feedback):\n        return feedback.get_email()\n\n    @staticmethod\n    def mark_message(feedback):\n        if feedback.gives_mark:\n            return u\"\\nV\u00e6r oppmerksom p\u00e5 at du f\u00e5r prikk dersom du ikke svarer \" \\\n            u\"p\u00e5 disse sp\u00f8rsm\u00e5lene innen fristen.\"\n        else:\n            return \"\"\n\n    @staticmethod\n    def set_marks(title, not_responded):\n        mark = Mark()\n        mark.title = u\"Manglende tilbakemelding p\u00e5 %s\" % (title)\n        mark.category = 4 #Missed feedback\n        mark.description = u\"Du har f\u00e5tt en prikk fordi du ikke har levert tilbakemelding.\"\n        mark.save()\n        \n        for user in not_responded:\n            user_entry = UserEntry()\n            user_entry.user = user\n            user_entry.mark = mark\n            user_entry.save()\n    \nclass Message():\n    subject = \"\"\n    intro = \"\"\n    start_date = \"\"\n    deadline = \"\"\n    mark = \"\"\n    contact = \"\"\n    link = \"\"\n    send = False\n    end = u\"\\n\\nMvh\\nLinjeforeningen Online\"\n    results_message = False\n\n    committee_mail = \"\"\n    attended_mails = False\n\n\n    def __unicode__(self):\n        message = \"%s %s %s %s %s %s %s\" % (\n            self.intro, \n            self.start_date, \n            self.link, \n            self.deadline, \n            self.mark, \n            self.contact, \n            self.end)\n        return message\n\nschedule.register(FeedbackMail, day_of_week='mon-sun', hour=8, minute=00)\n", "path": "apps/feedback/mommy.py"}]}