Make pm restriction code generic.
PEP8
Merge pull request #191 from onepercentclub/cowry-docdata-pm-restrictions-2

Make pm restriction code generic.