Beispiel #1
0
def submission_count(sender, **kwargs):
    parsed_instance = kwargs.get('instance')
    created = kwargs.get('created')
    if created:
        stat_log.delay(GLOBAL_SUBMISSION_STATS, 1)
        key = '%(username)s_%(xform_id_string)s_submissions'\
            % {"username": parsed_instance.instance.xform.user.username,
               "xform_id_string": parsed_instance.instance.xform.id_string}
        stat_log.delay(key, 1)
Beispiel #2
0
def submission_count(sender, **kwargs):
    parsed_instance = kwargs.get('instance')
    created = kwargs.get('created')
    if created:
        stat_log.delay(GLOBAL_SUBMISSION_STATS, 1)
        key = '%(username)s_%(xform_id_string)s_submissions'\
            % {"username": parsed_instance.instance.xform.user.username,
               "xform_id_string": parsed_instance.instance.xform.id_string}
        stat_log.delay(key, 1)
Beispiel #3
0
def stats_forms_created(sender, instance, created, **kwargs):
    if created:
        stat_log.delay('formhub-forms-created', 1)
Beispiel #4
0
 def test_task_stat_log(self):
     result = stat_log.delay("*", 1)
     self.assertEqual(
         (result.get().key, result.get().value), (u"*", 1))
     self.assertTrue(result.successful())
Beispiel #5
0
def stats_forms_created(sender, instance, created, **kwargs):
    if created:
        stat_log.delay('formhub-forms-created', 1)
Beispiel #6
0
 def test_task_stat_log(self):
     result = stat_log.delay("*", 1)
     self.assertEqual((result.get().key, result.get().value), (u"*", 1))
     self.assertTrue(result.successful())