Skip to content

Commit

Permalink
dan feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
owocki committed May 30, 2019
1 parent b58816e commit fe9bdb6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/dashboard/management/commands/sync_es_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ def handle(self, *args, **options):
es = EmailSubscriber.objects.filter(email=profile.email).exclude(keywords=[]).first()
if es:
print("2", es.keywords, profile.handle)
profile.keywords = es.keywords
profile.keywords = es.keywords + profile.keywords
profile.save()

# pull keywords by profile into ES
for es in EmailSubscriber.objects.filter(keywords=[]):
profile = Profile.objects.filter(email=es.email).exclude(keywords=[]).first()
if profile:
print("3", profile.keywords, profile.handle)
es.keywords = profile.keywords
es.keywords = es.keywords + profile.keywords
es.save()

#TODO: if a profile / emailsubscriber both have keywords we need to merge them

0 comments on commit fe9bdb6

Please sign in to comment.