mirror of
				https://github.com/Tivix/django-rest-auth.git
				synced 2025-11-04 01:27:36 +03:00 
			
		
		
		
	Fixes no-user issue
This commit is contained in:
		
							parent
							
								
									1dd2019614
								
							
						
					
					
						commit
						0be5b2dd15
					
				| 
						 | 
					@ -208,9 +208,6 @@ class PasswordResetConfirmSerializer(serializers.Serializer):
 | 
				
			||||||
    def validate(self, attrs):
 | 
					    def validate(self, attrs):
 | 
				
			||||||
        self._errors = {}
 | 
					        self._errors = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if not default_token_generator.check_token(self.user, attrs['token']):
 | 
					 | 
				
			||||||
            raise ValidationError({'token': ['Invalid value']})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        # Decode the uidb64 to uid to get User object
 | 
					        # Decode the uidb64 to uid to get User object
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            uid = force_text(uid_decoder(attrs['uid']))
 | 
					            uid = force_text(uid_decoder(attrs['uid']))
 | 
				
			||||||
| 
						 | 
					@ -218,6 +215,9 @@ class PasswordResetConfirmSerializer(serializers.Serializer):
 | 
				
			||||||
        except (TypeError, ValueError, OverflowError, UserModel.DoesNotExist):
 | 
					        except (TypeError, ValueError, OverflowError, UserModel.DoesNotExist):
 | 
				
			||||||
            raise ValidationError({'uid': ['Invalid value']})
 | 
					            raise ValidationError({'uid': ['Invalid value']})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if not default_token_generator.check_token(self.user, attrs['token']):
 | 
				
			||||||
 | 
					            raise ValidationError({'token': ['Invalid value']})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.custom_validation(attrs)
 | 
					        self.custom_validation(attrs)
 | 
				
			||||||
        # Construct SetPasswordForm instance
 | 
					        # Construct SetPasswordForm instance
 | 
				
			||||||
        self.set_password_form = self.set_password_form_class(
 | 
					        self.set_password_form = self.set_password_form_class(
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user