Skip to content

Commit

Permalink
Make listing image, social image, and social text required via wagtai…
Browse files Browse the repository at this point in the history
…l admin form instead
  • Loading branch information
Patrick Gan committed Jan 16, 2025
1 parent b376904 commit 2219748
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions rca/utils/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,18 @@ def __init__(self, *args, **kwargs):
"content users can expect to find on the page. <strong>Recommended length: 50 to 160 "
"characters</strong>."
)

# Listing Image field configuration
if listing_image_field := self.fields.get("listing_image"):
listing_image_field.required = True
listing_image_field.help_text = "This image is required for listings."

# Social Image field configuration
if social_image_field := self.fields.get("social_image"):
social_image_field.required = True
social_image_field.help_text = "You must specify a social image."

# Social Text field configuration
if social_text_field := self.fields.get("social_text"):
social_text_field.required = True
social_text_field.help_text = "You must specify a social text."

0 comments on commit 2219748

Please sign in to comment.