mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 14:27:42 +00:00
Giant refactor to rebrand "SIG" as "Activity" anywhere that doesn't touch API or config file (which is to be addressed in a future breaking change). #147
This commit is contained in:
@@ -6,9 +6,9 @@ import tornado
|
||||
from tornado import httputil
|
||||
from tornado.web import Application
|
||||
|
||||
from core.activity_utils import get_ref_regex_for_activity
|
||||
from core.config import ALLOW_SPOTTING
|
||||
from core.constants import UNKNOWN_BAND
|
||||
from core.sig_utils import get_ref_regex_for_sig
|
||||
from core.utils import infer_band_from_freq, safe_json_dumps
|
||||
from data.spot import Spot
|
||||
|
||||
@@ -104,14 +104,14 @@ class V1APISpotHandler(tornado.web.RequestHandler):
|
||||
self.set_header("Content-Type", "application/json")
|
||||
return
|
||||
|
||||
# Reject if sig_ref format incorrect for sig
|
||||
# Reject if activity ref format incorrect for activity
|
||||
if (
|
||||
spot.sig
|
||||
and spot.sig_refs
|
||||
and len(spot.sig_refs) > 0
|
||||
and spot.sig_refs[0].id
|
||||
and get_ref_regex_for_sig(spot.sig)
|
||||
and not re.match(get_ref_regex_for_sig(spot.sig), spot.sig_refs[0].id)
|
||||
and get_ref_regex_for_activity(spot.sig)
|
||||
and not re.match(get_ref_regex_for_activity(spot.sig), spot.sig_refs[0].id)
|
||||
):
|
||||
self.set_status(422)
|
||||
self.write(
|
||||
|
||||
Reference in New Issue
Block a user