fix: [helpers] Changed string formating to `format` and slight refact

pull/121/head
mokaddem 2019-08-28 15:54:37 +02:00
parent f009d81321
commit f2fb36601a
2 changed files with 4 additions and 4 deletions

View File

@ -111,7 +111,6 @@ class Contributor_helper:
self.keyTrophy = "CONTRIB_TROPHY"
self.keyLastAward = "CONTRIB_LAST_AWARDS"
''' HELPER '''
def getOrgLogoFromMISP(self, org):
return "{}/img/orgs/{}.png".format(self.misp_web_url, org)

View File

@ -208,9 +208,10 @@ class Geo_helper:
print("Please fix the above, and make sure you use a redis version that supports the GEOADD command.")
print("To test for support: echo \"help GEOADD\"| redis-cli")
self.logger.debug('Added to redis: keyname={}, lon={}, lat={}, content={}'.format(keyname, lon, lat, content))
def push_to_redis_zset(self, keyCateg, toAdd, endSubkey="", count=1):
if not isinstance(toAdd, str):
self.logger.warning(f'Can\'t add to redis, element is not of type String. {type(toAdd)}')
self.logger.warning('Can\'t add to redis, element is not of type String. {}'.format(type(toAdd)))
return
now = datetime.datetime.now()
today_str = util.getDateStrFormat(now)