diff --git a/app/service/Users.py b/app/service/Users.py index 4ea8cc3..74260ee 100644 --- a/app/service/Users.py +++ b/app/service/Users.py @@ -77,11 +77,12 @@ def update_user(self, user_id: int, update_data: dict): # es el propio usuario editando sus datos y no permitir # que un usuario edite los de un tercero self.get_user(user_id) - filtered_update_data = {k: v for k, v in update_data.items() - if v is not None} + filtered_update_data = {k: v for k, v in update_data.items() + if v is not None} if 'photo' in filtered_update_data: photo_url = filtered_update_data['photo'] if not re.match(r'^https?://(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,6}' - r'(?:/[^/#?]+)+\.(?:jpg|jpeg|png|gif)$', photo_url): + r'(?:/[^/#?]+)+\.(?:jpg|jpeg|png|gif)$', + photo_url): raise InvalidURL("Invalid photo URL") self.user_repository.edit_user(user_id, filtered_update_data)