Changeset cbdbd1f


Ignore:
Timestamp:
Jul 6, 2012, 2:49:11 AM (13 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, space-access, stable, stage
Children:
984dca1
Parents:
3496370
git-author:
Alex Dehnert <adehnert@…> (07/06/12 02:47:00)
git-committer:
Alex Dehnert <adehnert@…> (07/06/12 02:49:11)
Message:

Cap FYSM descriptions at 400 characters (ASA-#129)

Location:
asadb/forms
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • asadb/forms/models.py

    r3496370 rcbdbd1f  
    1616    join_url = models.URLField(verbose_name="recruiting URL", help_text="""<p>If you have a specific web page for recruiting new members of your group, you can link to it here. It will be used as the destination for most links about your group (join link on the main listing page and when clicking on the slide, but not the "website" link on the slide page). If you do not have such a page, use your main website's URL.</p>""")
    1717    contact_email = models.EmailField(help_text="Give an address for students interested in joining the group to email (e.g., an officers list)")
    18     description = models.TextField(help_text="Explain in about three or four sentences what your group does and why incoming freshmen should get involved. If you go over 400 characters, we may ask you to cut your description, cut it ourselves, and/or display only the beginning on the group listing pages.")
     18    description = models.TextField(help_text="Explain in about three or four sentences what your group does and why incoming freshmen should get involved. Do not use more than 400 characters.")
    1919    logo = models.ImageField(upload_to='fysm/logos', blank=True, )
    2020    slide = models.ImageField(upload_to='fysm/slides', default="", help_text="Upload a slide to display on the group detail page. This will be scaled to be at most 600x600 pixels. We recommend making it exactly that size.")
  • asadb/forms/views.py

    r3496370 rcbdbd1f  
    156156        return name
    157157
     158    def clean_description(self, ):
     159        description = self.cleaned_data['description']
     160        length = len(description)
     161        if length > 400:
     162            raise ValidationError("Descriptions are capped at 400 characters, and this one is %d characters." % (length, ))
     163        return description
     164
    158165@login_required
    159166def fysm_manage(request, group, ):
Note: See TracChangeset for help on using the changeset viewer.