Skip to content

Commit

Permalink
Use Organisational name
Browse files Browse the repository at this point in the history
Signed-off-by: lincmba <[email protected]>
  • Loading branch information
lincmba committed Jul 24, 2020
1 parent 9af8443 commit c7caace
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions onadata/apps/messaging/backends/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
"""
from __future__ import unicode_literals

from django.utils.module_loading import import_string

from actstream.models import Action
from django.utils.module_loading import import_string
from multidb.pinning import use_master


Expand Down
3 changes: 2 additions & 1 deletion onadata/apps/messaging/backends/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ def get_topic(self, instance):
}
if kwargs['target_name'] == XFORM:
xform = XForm.objects.get(id=instance.target_object_id)
kwargs['organization_username'] = xform.project.organization.id
kwargs[
'organization_username'] = xform.project.organization.username
kwargs['verb'] = VERB_TOPIC_DICT[instance.verb]
kwargs['project_id'] = xform.project.id
return ('/{topic_base}/organization/{organization_username}/'
Expand Down
1 change: 1 addition & 0 deletions onadata/apps/messaging/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def messaging_backends_handler(sender, **kwargs): # pylint: disable=W0613
created = kwargs.get('created')
instance = kwargs.get('instance')
if instance and created:
instance = instance.save()
for name in backends:
backend = backends[name]['BACKEND']
backend_options = backends[name].get('OPTIONS')
Expand Down
2 changes: 1 addition & 1 deletion onadata/libs/utils/logger_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def _get_instance(xml, new_uuid, submitted_by, status, xform, checksum):
# send notification on submission creation
send_message(
instance_id=instance.id, target_id=instance.xform.id,
target_type=XFORM, user=instance.user,
target_type=XFORM, user=instance.user or instance.xform.user,
message_verb=message_verb)
return instance

Expand Down

0 comments on commit c7caace

Please sign in to comment.