Karma point for creating a new keyword
authorCharles Connell <charles@connells.org>
Tue, 13 May 2014 18:26:23 +0000 (14:26 -0400)
committerCharles Connell <charles@connells.org>
Tue, 13 May 2014 18:26:23 +0000 (14:26 -0400)
karmaworld/apps/notes/views.py
karmaworld/apps/users/models.py

index 04203e16f22a888bac4762e3087d97f8b3471738..d491cf32147fa8e4ac7f76dc6b5ae40f4e10d532 100644 (file)
@@ -220,6 +220,7 @@ class NoteKeywordsView(FormView, SingleObjectMixin):
                     keyword_object = Keyword.objects.get(id=id)
                 except (ValueError, ObjectDoesNotExist):
                     keyword_object = Keyword()
+                    NoteKarmaEvent.create_event(self.request.user, self.get_object(), NoteKarmaEvent.CREATED_KEYWORD)
 
                 keyword_object.note = self.get_object()
                 keyword_object.word = word
index 7816b61047300856e7feb112d7185893860a8aab..1caea61731bfe4d0959e94bf89d0bcc9c77331a4 100644 (file)
@@ -165,6 +165,7 @@ class NoteKarmaEvent(BaseKarmaEvent):
     GET_FLAGGED  = 'get_flagged'
     DOWNLOADED_NOTE = 'downloaded'
     HAD_NOTE_DOWNLOADED = 'was_downloaded'
+    CREATED_KEYWORD = 'created_keyword'
 
     EVENT_TYPE_CHOICES = (
         (UPLOAD,       "You uploaded a note"),
@@ -174,6 +175,7 @@ class NoteKarmaEvent(BaseKarmaEvent):
         (GET_FLAGGED,  "Your note was flagged as spam"),
         (DOWNLOADED_NOTE,  "You downloaded a note"),
         (HAD_NOTE_DOWNLOADED,  "Your note was downloaded"),
+        (CREATED_KEYWORD,  "You created a keyword"),
     )
     note = models.ForeignKey('notes.Note')
     event_type = models.CharField(max_length=15, choices=EVENT_TYPE_CHOICES)
@@ -186,6 +188,7 @@ class NoteKarmaEvent(BaseKarmaEvent):
         GET_FLAGGED: -100,
         DOWNLOADED_NOTE: -2,
         HAD_NOTE_DOWNLOADED: 2,
+        CREATED_KEYWORD: 1,
     }
 
     def get_message(self):