fix: replace autodoc with autoapi (#35846)

This commit is contained in:
Irtaza Akram
2024-11-18 10:16:09 +05:00
committed by GitHub
parent 26afafa81f
commit 68a626a938
7 changed files with 43 additions and 14 deletions

View File

@@ -51,11 +51,11 @@ def format_social_link(platform_name, new_social_link):
"""
Given a user's social link, returns a safe absolute url for the social link.
Returns the following based on the provided new_social_link:
1) Given an empty string, returns ''
1) Given a valid username, return 'https://www.[platform_name_base][username]'
2) Given a valid URL, return 'https://www.[platform_name_base][username]'
3) Given anything unparseable, returns None
Returns:
- An empty string if `new_social_link` is empty.
- A formatted URL if `new_social_link` is a username.
- Returns `new_social_link` if it is a valid URL.
- None for unparseable inputs.
"""
# Blank social links should return '' or None as was passed in.
if not new_social_link: