Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 3
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())
Exemplo n.º 4
0
def stats_forms_created(sender, instance, created, **kwargs):
    if created:
        stat_log.delay('formhub-forms-created', 1)
Exemplo n.º 5
0
def stats_forms_created(sender, instance, created, **kwargs):
    if created:
        stathat_count('formhub-forms-created')
        stat_log.delay('formhub-forms-created', 1)