Skip to content

Commit

Permalink
Merge 791bd15 into 3803747
Browse files Browse the repository at this point in the history
  • Loading branch information
tsilva committed Jun 8, 2016
2 parents 3803747 + 791bd15 commit 00dc604
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/budy/models/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,24 @@ def _build_short_name(cls, first_name, last_name, limit = 16):
last = last_name[0] + "." if last_name else ""
return first + (" " + last if last else "")

@classmethod
@appier.link(
name = "Import Social CSV",
parameters = (
("CSV File", "file", "file")
)
)
def import__social_csv_s(cls, file):

def callback(line):
username, facebook_id, google_id = line
account = cls.get(username = username)
if facebook_id: account.facebook_id = facebook_id
if google_id: account.google_id = google_id
account.save()

cls._csv_import(file, callback)

def pre_create(self):
appier_extras.admin.Account.pre_create(self)
if not hasattr(self, "first_name") or not self.first_name:
Expand Down

0 comments on commit 00dc604

Please sign in to comment.