Skip to content

Commit

Permalink
maybe fix nsfw
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Aug 29, 2024
1 parent 90b3616 commit 8abc19b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/contrib.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,17 @@ async def suggest_api(

changed = {}

nsfw: bool | None = None

for key in ["name", "infobox", "summary"]:
before = original_wiki[key]
after = getattr(data, key)
if before != after:
changed[key] = after
original[key] = before

if original_wiki["nsfw"] != (data.nsfw is not None): # true case
nsfw = not original_wiki["nsfw"]
nsfw: bool | None = None
nsfw_input = data.nsfw is not None
if original_wiki["nsfw"] != nsfw_input: # true case
nsfw = nsfw_input

if (not changed) and (nsfw is None):
raise HTTPException("no changes found", status_code=400)
Expand Down

0 comments on commit 8abc19b

Please sign in to comment.