diff options
author | lxf <sng@luxagraf.net> | 2019-05-25 15:10:38 +0000 |
---|---|---|
committer | lxf <sng@luxagraf.net> | 2019-05-25 15:10:38 +0000 |
commit | dd09ca3810ea0798899870930c3efb388b776a7c (patch) | |
tree | 0cf0f8ba6c44b774a0867f48fce9cafb96620974 /app/utils | |
parent | fc037fa9bf0eee9920ae1da14ce80d594f39cba4 (diff) |
made some changes to use new checkin model
Diffstat (limited to 'app/utils')
-rw-r--r-- | app/utils/util.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/utils/util.py b/app/utils/util.py index 1779baa..b765e78 100644 --- a/app/utils/util.py +++ b/app/utils/util.py @@ -35,7 +35,7 @@ def convertll(lat, lon): def get_latlon(): - loc = apps.get_model('locations', 'CheckIn').objects.latest() + loc = apps.get_model('locations', 'LuxCheckIn').objects.latest() lat_converted, lon_converted = convertll(loc.lat, loc.lon) return lat_converted, lon_converted @@ -55,8 +55,11 @@ def parse_image(s): for img in soup.find_all('img'): try: cl = img['class'] - if cl[0] == 'postpic' or cl[0] == 'postpicright': + #if cl[0] == 'postpic' or cl[0] == 'postpicright': + replacer = "[[base_url]]" + if replacer in str(img): s = str(img).replace('[[base_url]]', settings.IMAGES_URL) + print(s) return s else: try: |