Closed Bug 950913 Opened 9 years ago Closed 8 years ago

TRUNCATE_LENGTH

Categories

(Input Graveyard :: Code Quality, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: willkg, Assigned: aokoye)

Details

(Whiteboard: u=dev c=codequality p= s=input.2014q4)

We define a TRUNCATE_LENGTH in fjord/feedback/models.py. We have the same number in a few other places. We should move that somewhere that is accessible to all the places using it and document it.
Whiteboard: u=dev c=codequality p= s=input.adam
The number "10000" shows up in a couple of different contexts, but the only one we're concerned with here is TRUNCATE_LENGTH.

Doing a grep across the code removing irrelevant hits yields this:

<fjord> (M=f8dd1 fjord/) saturn2 ~/mozilla/fjord/fjord> grin 10000
./feedback/models.py:
   39 : TRUNCATE_LENGTH = 10000
./feedback/templates/feedback/fxos_feedback.html:
  109 :           <textarea data-max-length="10000" id="description" name="description" cols="40" rows="4"></textarea>
./feedback/templates/feedback/generic_feedback_form.html:
   56 :         <textarea data-max-length="10000" id="description" name="description" cols="40" rows="4"></textarea>
./feedback/templates/feedback/generic_feedback_form_dev.html:
   99 :             <div id="description-counter">10000</div>
  100 :             <textarea data-max-length="10000" id="description" name="description"></textarea>
./feedback/tests/test_models.py:
   27 :         eq_(resp.description, 'a' * 10000)


The generic_feedback_form.html and generic_feedback_form_dev.html templates are getting merged soon. That'll end up being one place.

The rest of these should pull from a configuration "constant".
Assignee: nobody → aokoye
Pushed this to prod just now. Thank you!
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Moving things out of the input.adam sprint.
Whiteboard: u=dev c=codequality p= s=input.adam → u=dev c=codequality p= s=input.2014q4
Product: Input → Input Graveyard
You need to log in before you can comment on or make changes to this bug.