models: Add external_account in custom profile field types.

Add new custom profile field type, External account.
External account field links user's social media
profile with account. e.g. GitHub, Twitter, etc.

Fixes part of #12302
This commit is contained in:
Yashashvi Dave
2019-05-27 14:29:55 +05:30
committed by Tim Abbott
parent 3368589df2
commit d7ee2aced1
20 changed files with 384 additions and 12 deletions

View File

@@ -2613,6 +2613,7 @@ class CustomProfileField(models.Model):
DATE = 4
URL = 5
USER = 6
EXTERNAL_ACCOUNT = 7
# These are the fields whose validators require more than var_name
# and value argument. i.e. CHOICE require field_data, USER require
@@ -2637,6 +2638,7 @@ class CustomProfileField(models.Model):
(LONG_TEXT, str(_('Long text')), check_long_string, str, "LONG_TEXT"),
(DATE, str(_('Date picker')), check_date, str, "DATE"),
(URL, str(_('Link')), check_url, str, "URL"),
(EXTERNAL_ACCOUNT, str(_('External account')), check_short_string, str, "EXTERNAL_ACCOUNT"),
] # type: FieldTypeData
ALL_FIELD_TYPES = FIELD_TYPE_DATA + CHOICE_FIELD_TYPE_DATA + USER_FIELD_TYPE_DATA