mirror of
				https://github.com/ae-utbm/sith.git
				synced 2025-11-04 11:03:04 +00:00 
			
		
		
		
	* update_spam_database command to update suspicious domains from an external provider * Add a AntiSpamEmailField that deny emails from suspicious domains * Update documentation
		
			
				
	
	
		
			20 lines
		
	
	
		
			594 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			594 B
		
	
	
	
		
			Python
		
	
	
	
	
	
from django.db import models
 | 
						|
from django.utils.translation import gettext_lazy as _
 | 
						|
 | 
						|
 | 
						|
class ToxicDomain(models.Model):
 | 
						|
    """Domain marked as spam in public databases"""
 | 
						|
 | 
						|
    domain = models.URLField(_("domain"), max_length=253, primary_key=True)
 | 
						|
    created = models.DateTimeField(auto_now_add=True)
 | 
						|
    is_externally_managed = models.BooleanField(
 | 
						|
        _("is externally managed"),
 | 
						|
        default=False,
 | 
						|
        help_text=_(
 | 
						|
            "True if kept up-to-date using external toxic domain providers, else False"
 | 
						|
        ),
 | 
						|
    )
 | 
						|
 | 
						|
    def __str__(self) -> str:
 | 
						|
        return self.domain
 |