fix: Remove obsolete AccountRequest model

This commit is contained in:
aldrin 2021-05-19 10:11:13 +02:00
parent 048c8927b8
commit 7bf70c933b
4 changed files with 17 additions and 23 deletions

View file

@ -0,0 +1,16 @@
# Generated by Django 2.2.20 on 2021-05-19 08:10
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('userausfall', '0004_user_confidant'),
]
operations = [
migrations.DeleteModel(
name='AccountRequest',
),
]

View file

@ -101,15 +101,3 @@ class User(AbstractBaseUser, PermissionsMixin):
def email_user(self, subject, message, from_email=None, **kwargs):
"""Send an email to this user."""
send_mail(subject, message, from_email, [self.email], **kwargs)
class AccountRequest(models.Model):
created_time = models.DateTimeField(auto_now_add=True)
email = models.EmailField()
is_verified = models.BooleanField(default=False)
confidant_email = models.EmailField(blank=True)
is_trustable = models.BooleanField(default=False)
username = models.CharField(max_length=100, blank=True)

View file

@ -1,6 +1,6 @@
from rest_framework import serializers
from userausfall.models import AccountRequest, User
from userausfall.models import User
class UserSerializer(serializers.ModelSerializer):

View file

@ -1,10 +0,0 @@
from django.db.models.signals import post_save
from django.dispatch import receiver
from userausfall.models import AccountRequest
@receiver(post_save, sender=AccountRequest)
def account_request_saved(sender, instance: AccountRequest, **kwargs):
if instance.is_verified and instance.is_trustable and instance.username:
print('Create account and send password mail')