Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add escalation actions to activitylog migrate

  • Loading branch information...
commit 31e7f8d6dd47d0a01e80b48f74bace28f5cf5ec6 1 parent ba9cd1f
@ngokevin ngokevin authored
View
3  mkt/comm/management/commands/migrate_activity_log.py
@@ -59,8 +59,7 @@ def _migrate_activity_log(logs, **kwargs):
# Create note.
note = CommunicationNote.objects.create(
# Developers should not see escalate/reviewer comments.
- read_permission_developer=action not in (cmb.ESCALATION,
- cmb.REVIEWER_COMMENT),
+ read_permission_developer=action not in cmb.REVIEWER_NOTE_TYPES,
**note_params)
note.update(created=log.created)
View
18 mkt/comm/tests/test_commands.py
@@ -77,6 +77,24 @@ def test_migrate_noaction(self):
user=self.user, details={'comments': 'something'})
self._assert(cmb.NO_ACTION)
+ def test_migrate_escalation_high_abuse(self):
+ amo.log(amo.LOG.ESCALATED_HIGH_ABUSE, self.app, self.version,
+ user=self.user, details={'comments': 'something'})
+ thread, note = self._assert(cmb.ESCALATION_HIGH_ABUSE)
+ assert not note.read_permission_developer
+
+ def test_migrate_escalation_high_refunds(self):
+ amo.log(amo.LOG.ESCALATED_HIGH_REFUNDS, self.app, self.version,
+ user=self.user, details={'comments': 'something'})
+ thread, note = self._assert(cmb.ESCALATION_HIGH_REFUNDS)
+ assert not note.read_permission_developer
+
+ def test_migrate_escalation_cleared(self):
+ amo.log(amo.LOG.ESCALATION_CLEARED, self.app, self.version,
+ user=self.user, details={'comments': 'something'})
+ thread, note = self._assert(cmb.ESCALATION_CLEARED)
+ assert not note.read_permission_developer
+
def test_get_or_create(self):
amo.log(amo.LOG.REQUEST_VERSION, self.app, self.version,
user=self.user, details={'comments': 'something'})
View
12 mkt/constants/comm.py
@@ -40,10 +40,14 @@
REREVIEW_CLEARED: _('Re-review cleared')
}
-
-def NOTE_TYPES_JSON():
- return json.dumps(dict(
- (k, unicode(v)) for k, v in NOTE_TYPES.items()))
+# Note types only visible by reviewers and not developers.
+REVIEWER_NOTE_TYPES = (
+ ESCALATION,
+ REVIEWER_COMMENT,
+ ESCALATION_HIGH_ABUSE,
+ ESCALATION_HIGH_REFUNDS,
+ ESCALATION_CLEARED
+)
# Prefix of the reply to address in comm emails.
Please sign in to comment.
Something went wrong with that request. Please try again.