Skip to content

Commit 77eeddc

Browse files
authored
[ENG-10586] remove orcid from user social (#11684)
* delete user social orcid using management command ( need recatalog_metadata --users run to sync the data to SHARE ) * add terminal command run option with 'python3 manage.py remove_orcid_from_social'
1 parent 182132a commit 77eeddc

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
from django.core.management.base import BaseCommand
12
from django.db.models.expressions import RawSQL
23
from osf.models import OSFUser
34

45

56
def remove_orcid_from_user_social():
67
OSFUser.objects.filter(social__has_key='orcid').update(social=RawSQL("""social #- '{orcid}'""", []))
8+
9+
10+
class Command(BaseCommand):
11+
def handle(self, *args, **kwargs):
12+
remove_orcid_from_user_social()

0 commit comments

Comments
 (0)