Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Campaign Alias handling bug #91

Closed
cobsec opened this issue Dec 8, 2017 · 1 comment
Closed

Campaign Alias handling bug #91

cobsec opened this issue Dec 8, 2017 · 1 comment
Labels
Milestone

Comments

@cobsec
Copy link

cobsec commented Dec 8, 2017

Hey all - seems to be a bug with converting campaign entities that have aliases / names from 1 to 2. TypeError raised:
screen shot 2017-12-08 at 11 05 27
screen shot 2017-12-08 at 11 06 56

You can see that an object is trying to be string'd rather than the value so can't get json serialised. I had a play and think I found the problem:

def convert_campaign(camp, bundle_instance, parent_created_by_ref, parent_timestamp):
    campaign_instance = create_basic_object("campaign", camp, parent_timestamp)
    process_description_and_short_description(campaign_instance, camp)
    campaign_instance["name"] = camp.title
    if camp.names is not None:
        campaign_instance["aliases"] = []
        for name in camp.names:
            campaign_instance["aliases"].append(name)
    # process information source before any relationships

append(name) should read append(name.value) I think?

Making the change seems to work for my test case:
screen shot 2017-12-08 at 11 11 24

@gtback
Copy link
Contributor

gtback commented Jan 10, 2018

Thanks for opening this, @cobsec and sorry for not seeing it right away. I'll hopefully have a chance to look at it soon.

@gtback gtback added the bug label Jun 15, 2018
@gtback gtback added this to the 1.2.0 milestone Jun 15, 2018
@rpiazza rpiazza closed this as completed in 5c901d2 Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants