mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 14:11:09 -05:00
18 lines
769 B
Python
18 lines
769 B
Python
from django.core.management.base import BaseCommand
|
|
from django.db import connection
|
|
|
|
class Command(BaseCommand):
|
|
help = 'Reset social auth configuration'
|
|
|
|
def handle(self, *args, **options):
|
|
with connection.cursor() as cursor:
|
|
# Delete all social apps
|
|
cursor.execute("DELETE FROM socialaccount_socialapp")
|
|
cursor.execute("DELETE FROM socialaccount_socialapp_sites")
|
|
|
|
# Reset sequences
|
|
cursor.execute("DELETE FROM sqlite_sequence WHERE name='socialaccount_socialapp'")
|
|
cursor.execute("DELETE FROM sqlite_sequence WHERE name='socialaccount_socialapp_sites'")
|
|
|
|
self.stdout.write(self.style.SUCCESS('Successfully reset social auth configuration'))
|