| 28 | |
| 29 | |
| 30 | class EncryptedPasswordProfileSerializer(serializers.ModelSerializer): |
| 31 | class Meta: |
| 32 | model = models.EncryptedPasswordProfile |
| 33 | fields = ( |
| 34 | "id", |
| 35 | "password_profile", |
| 36 | "created", |
| 37 | "modified", |
| 38 | ) |
| 39 | read_only_fields = ("created", "modified") |
| 40 | |
| 41 | def create(self, validated_data): |
| 42 | user = self.context["request"].user |
| 43 | return models.EncryptedPasswordProfile.objects.create( |
| 44 | user=user, **validated_data |
| 45 | ) |
| 46 | |
| 47 | |
| 48 | class BackwardCompatibleTokenObtainPairSerializer(TokenObtainPairSerializer): |
nothing calls this directly
no outgoing calls
no test coverage detected