mirror of
https://github.com/yaroslaff/antifraud2gis.git
synced 2026-10-15 13:44:14 +00:00
handle med-style companies
This commit is contained in:
parent
ee4d982270
commit
7e904f11ff
5 changed files with 24 additions and 5 deletions
|
|
@ -113,7 +113,15 @@ aliases = {
|
|||
'70000001017423547': {
|
||||
'alias': 'hotdogmaster3'
|
||||
},
|
||||
'70000001099184992': {
|
||||
'alias': 'revolution',
|
||||
'remark': 'very few reviews, good for quick tests'
|
||||
},
|
||||
|
||||
'70000001035102877': {
|
||||
'alias': 'dikul',
|
||||
'remark': 'should be error, medical, no back-reviews'
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ from ..tasks import submit_fraud_task, cooldown_queue
|
|||
from ..logger import loginit, logger, testlogger
|
||||
from ..db import db
|
||||
from ..const import REDIS_DRAMATIQ_QUEUE
|
||||
from ..exceptions import AFNoCompany, AFReportNotReady, AFReportAlreadyExists, AFNoTitle
|
||||
from ..exceptions import AFNoCompany, AFReportNotReady, AFReportAlreadyExists, AFNoTitle, AFCompanyError
|
||||
from ..settings import settings
|
||||
from ..statistics import statistics
|
||||
from ..aliases import resolve_alias
|
||||
|
|
@ -110,7 +110,10 @@ def main():
|
|||
|
||||
elif args.cmd == "aliases":
|
||||
for oid, alias_rec in aliases.items():
|
||||
print(f"{oid} = {alias_rec['alias']}")
|
||||
remark = alias_rec.get('remark', '')
|
||||
remark = f'({remark})' if remark else ''
|
||||
|
||||
print(f"{oid} = {alias_rec['alias']} {remark}")
|
||||
|
||||
elif args.cmd == "compare":
|
||||
if len(args.args) != 2:
|
||||
|
|
@ -173,7 +176,7 @@ def main():
|
|||
if args.company and args.cmd not in ['wipe']:
|
||||
try:
|
||||
Company(args.company)
|
||||
except (AFNoCompany, AFNoTitle):
|
||||
except (AFNoCompany, AFNoTitle, AFCompanyError):
|
||||
print("No such company (geo or no 2gis reviews)")
|
||||
return
|
||||
|
||||
|
|
|
|||
|
|
@ -415,6 +415,14 @@ class Company:
|
|||
def update_title_by_reviews(self):
|
||||
self.load_reviews()
|
||||
self.load_users()
|
||||
|
||||
try:
|
||||
self.update_title()
|
||||
except AFCompanyNotFound:
|
||||
logger.debug(f"Broken company {self.object_id} (no reviews or medical)")
|
||||
self.error = True
|
||||
self.save_basic()
|
||||
|
||||
return
|
||||
|
||||
for r in self._reviews:
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ def update_company(company_data: dict, conn = None):
|
|||
|
||||
# Extract values from the dictionary and map them to the placeholders
|
||||
cursor.execute(sql, (
|
||||
company_data.get("oid"),
|
||||
company_data.get("oid"),
|
||||
company_data.get("title"),
|
||||
company_data.get("address"),
|
||||
company_data.get("town"),
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
Код будет в строке адреса, после <code>/firm/</code> когда вы просматриваете страничку компании.
|
||||
</p>
|
||||
<p>
|
||||
Или просто добавьте буквы "af" перед 2gis в этом адресе, чтобы получился адрес на <a href="https://af2gis.ru/">af2gis.ru</a>.
|
||||
Или просто добавьте буквы "af" перед 2gis.ru в этом адресе, чтобы получился адрес на <a href="https://af2gis.ru/">af2gis.ru</a>.
|
||||
</p>
|
||||
<div>
|
||||
<img src="/static/img/oid.png">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue