2020-07-03 02:11:02 -04:00
|
|
|
# this command helps with development. It removes the last created user
|
|
|
|
# in case there was a problem with creating a user and profile manually.
|
|
|
|
from django.conf import settings
|
|
|
|
from django.contrib.auth.models import User
|
|
|
|
from django.core.management.base import BaseCommand
|
|
|
|
|
|
|
|
from apps.profile.models import Profile
|
|
|
|
|
2024-04-24 09:43:56 -04:00
|
|
|
|
|
|
|
class Command(BaseCommand):
|
2020-07-03 02:11:02 -04:00
|
|
|
def handle(self, *args, **options):
|
|
|
|
user = User.objects.last()
|
2024-04-24 09:43:56 -04:00
|
|
|
profile = Profile.objects.get(user=user)
|
2020-07-03 02:11:02 -04:00
|
|
|
profile.delete()
|
|
|
|
user.delete()
|
2024-04-24 09:43:56 -04:00
|
|
|
print("User and profile for user {0} deleted".format(user))
|