Created
August 25, 2020 06:10
-
-
Save velotiotech/e2d8deff68d4beef99f1c2c1aafb7533 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# read the context data in the serializer validation method | |
class UserSerializer(serializer.Serializer): | |
def validate_email(self, val): | |
valid_domains = serf.context.get("valid_domains") | |
# main validation logic goes here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment