mirror of
https://github.com/TrentSPalmer/trentpalmerdotorg.git
synced 2024-11-21 17:11:30 -08:00
add twitter_handle_validator to accounts/models.py
This commit is contained in:
parent
f82131855f
commit
82ac0350f3
@ -1,6 +1,12 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
from tp.models import UUIDAsIDModel
|
from tp.models import UUIDAsIDModel
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
|
from django.core.exceptions import ValidationError
|
||||||
|
|
||||||
|
|
||||||
|
def twitter_handle_validator(x):
|
||||||
|
if x[0] != '@':
|
||||||
|
raise ValidationError('twitter_handle must begin with "@"')
|
||||||
|
|
||||||
|
|
||||||
class EmailWhiteList(UUIDAsIDModel):
|
class EmailWhiteList(UUIDAsIDModel):
|
||||||
|
Loading…
Reference in New Issue
Block a user