URL fix
Details
Details
Diff Detail
Diff Detail
- Repository
- rRSDB resultsdb
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
kparal |
resultsdb |
URL fix
NA
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Path | Packages | |||
---|---|---|---|---|
M | resultsdb/controllers/api_v1.py (4 lines) |
Commit | Tree | Parents | Author | Summary | Date |
---|---|---|---|---|---|
90f5f5d17f9c | b4d7760024c1 | 382bcacf4646 | sumantro93 | URL fixes (Show More…) | Feb 21 2017, 8:10 PM |
Show First 20 Lines • Show All 134 Lines • ▼ Show 20 Line(s) | |||||
135 | 135 | | |||
136 | def parse_since(since): | 136 | def parse_since(since): | ||
137 | since_start = None | 137 | since_start = None | ||
138 | since_end = None | 138 | since_end = None | ||
139 | if since is not None: | 139 | if since is not None: | ||
140 | s = since.split(',') | 140 | s = since.split(',') | ||
141 | try: | 141 | try: | ||
142 | since_start = iso8601.parse_date(s[0]) | 142 | since_start = iso8601.parse_date(s[0]) | ||
143 | # https://phab.qadevel.cloud.fedoraproject.org/T246 | 143 | # https://phab.qa.fedoraproject.org/T246 | ||
144 | since_start = since_start.replace(tzinfo=None) # we need to strip timezone info | 144 | since_start = since_start.replace(tzinfo=None) # we need to strip timezone info | ||
145 | # Yes, this library sucks in Exception handling.. | 145 | # Yes, this library sucks in Exception handling.. | ||
146 | except (TypeError, ValueError, iso8601.iso8601.ParseError): | 146 | except (TypeError, ValueError, iso8601.iso8601.ParseError): | ||
147 | raise iso8601.iso8601.ParseError() | 147 | raise iso8601.iso8601.ParseError() | ||
148 | try: | 148 | try: | ||
149 | since_end = iso8601.parse_date(s[1]) | 149 | since_end = iso8601.parse_date(s[1]) | ||
150 | # https://phab.qadevel.cloud.fedoraproject.org/T246 | 150 | # https://phab.qa.fedoraproject.org/T246 | ||
151 | since_end = since_end.replace(tzinfo=None) # we need to strip timezone info | 151 | since_end = since_end.replace(tzinfo=None) # we need to strip timezone info | ||
152 | except IndexError: # since contained just one datetime | 152 | except IndexError: # since contained just one datetime | ||
153 | pass | 153 | pass | ||
154 | # Yes, this library sucks in Exception handling.. | 154 | # Yes, this library sucks in Exception handling.. | ||
155 | except (TypeError, ValueError, iso8601.iso8601.ParseError): | 155 | except (TypeError, ValueError, iso8601.iso8601.ParseError): | ||
156 | raise iso8601.iso8601.ParseError() | 156 | raise iso8601.iso8601.ParseError() | ||
157 | return since_start, since_end | 157 | return since_start, since_end | ||
158 | 158 | | |||
▲ Show 20 Lines • Show All 553 Lines • Show Last 20 Lines |