file_url
This commit is contained in:
@@ -5,6 +5,7 @@ from marshmallow import ValidationError
|
||||
import logging
|
||||
from app.api.integrations import KafkaIntegration
|
||||
from app.config import Config
|
||||
from app.models import MembersWebfiles
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
from app.api.integrations import StripeIntegration
|
||||
@@ -30,7 +31,21 @@ class BaseService:
|
||||
CACHE_SERVER = Config.CACHE_SERVER
|
||||
CACHE_PORT = Config.CACHE_PORT
|
||||
CACHE_PASSWORD = Config.CACHE_PASSWORD
|
||||
CACHE_DEFAULT_EXPIRE = Config.CACHE_DEFAULT_EXPIRE
|
||||
CACHE_DEFAULT_EXPIRE = Config.CACHE_DEFAULT_EXPIRE
|
||||
MEDIA_SERVER = Config.MEDIA_SERVER
|
||||
|
||||
@staticmethod
|
||||
def get_profile_picture_url(profile_uid):
|
||||
file_url = ''
|
||||
if profile_uid is None or profile_uid == '':
|
||||
return file_url
|
||||
|
||||
selectedFile = MembersWebfiles.get_member_webfiles_by_file_uid(profile_uid)
|
||||
if selectedFile:
|
||||
file_url = (
|
||||
BaseService.MEDIA_SERVER + "/" + selectedFile.file_group + "/" + str(
|
||||
selectedFile.uid) + "/" + selectedFile.filename).lower()
|
||||
return file_url
|
||||
|
||||
@staticmethod
|
||||
def addStripeCustomer(customerData):
|
||||
@@ -396,7 +411,7 @@ class BaseService:
|
||||
def write_cache_data(cacheSection, cacheId, cacheData):
|
||||
|
||||
try:
|
||||
cacheKey = "MERMS-"+ cacheSection + '-' + cacheId # note theh use of -
|
||||
cacheKey = "MERMS-" + cacheSection + '-' + cacheId # note theh use of -
|
||||
logger.info(f"write_cache_data () key {cacheKey}", exc_info=True)
|
||||
# Define connection parameters and connect
|
||||
r = redis.Redis(host=BaseService.CACHE_SERVER, port=BaseService.CACHE_PORT,
|
||||
|
||||
Reference in New Issue
Block a user