Skip to content
This repository has been archived by the owner on May 28, 2019. It is now read-only.

Commit

Permalink
vuln: add comment to limit states slugify function [3]
Browse files Browse the repository at this point in the history
  • Loading branch information
nastasi-oq authored and daniviga committed Oct 22, 2015
1 parent 6ae0544 commit d8dcb91
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions openquakeplatform/openquakeplatform/vulnerability/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -986,9 +986,11 @@ def _stream_vuln_discr_data(curr, func_obj, is_first):


def _limit_states_slugify(limit_states):
"""replace limit states lowercased names with themselves where
"""
replace limit states lowercased names with themselves where
all [^a-z0-9] chars are substituted with '_' and contiguous '_' are
collapsed into one"""
collapsed into one
"""

return re.sub(r"_+", "_", re.sub(r"[^a-z0-9;]", "_", limit_states.lower())
).replace(";", " ")
Expand Down

0 comments on commit d8dcb91

Please sign in to comment.