SaturdayNeighborhoodHealthClinic / osler

The SNHC's patient tracking and clinic tools.
GNU General Public License v3.0
15 stars 9 forks source link

Remove instances of *.objects.all()[0] #255

Open justinrporter opened 4 years ago

justinrporter commented 4 years ago

There are a few instances in the code of using *.objects.all()[0] instead of *.objects.first(). This is an antipattern, but because there are examples of it, people take it to heart.

Using grep, you should be able to identify all instances of this (e.g. grep 'all()\[0\]' $( find . -name '*.py' )).

Using find and replace with sed (linux, macos), you can fix it in bulk.