Skip to content

Commit

Permalink
add function to move contact FK to contacts many to many field
Browse files Browse the repository at this point in the history
  • Loading branch information
rwblair committed Oct 7, 2016
1 parent cc6ca4f commit 5829c35
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion open_fmri/apps/dataset/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,13 @@ def save(self, *args, **kwargs):
list_serv_notify(self)
if settings.TWITTER_NOTIFY:
twitter_notify(self)


def migrate_contacts():
datasets = Dataset.objects.all()
for dataset in datasets:
if dataset.contact:
dataset.contacts.add(dataset.contact.pk)

def list_serv_notify(dataset):
subject = "New dataset avaliable on OpenfMRI.org"
body = render_to_string(
Expand Down

0 comments on commit 5829c35

Please sign in to comment.