Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
孙永强 committed Nov 6, 2024
1 parent e46bf3e commit d0a9ccd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions seahub/notifications/management/commands/send_file_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ def handle(self, *args, **options):
logger.debug('Finish sending file updates emails.\n')
self.stdout.write('[%s] Finish sending file updates emails.\n\n' % str(datetime.now()))

def get_avatar(self, username, default_size=32):
img_tag = avatar(username, default_size)
def get_avatar(self, username):
img_tag = avatar(username, 128)
pattern = r'src="(.*)"'
repl = r'src="%s\1"' % get_site_scheme_and_netloc()
return re.sub(pattern, repl, img_tag)

def get_avatar_src(self, username, default_size=32):
avatar_img = self.get_avatar(username, default_size)
def get_avatar_src(self, username):
avatar_img = self.get_avatar(username)
m = re.search('<img src="(.*?)".*', avatar_img)
if m:
return m.group(1)
Expand Down
8 changes: 4 additions & 4 deletions seahub/notifications/management/commands/send_notices.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ def handle(self, *args, **options):
self.do_action()
logger.debug('Finish sending user notices.\n')

def get_avatar(self, username, default_size=32):
img_tag = avatar(username, default_size)
def get_avatar(self, username):
img_tag = avatar(username, 128)
pattern = r'src="(.*)"'
repl = r'src="%s\1"' % get_site_scheme_and_netloc()
return re.sub(pattern, repl, img_tag)

def get_avatar_src(self, username, default_size=32):
avatar_img = self.get_avatar(username, default_size)
def get_avatar_src(self, username):
avatar_img = self.get_avatar(username)
m = re.search('<img src="(.*?)".*', avatar_img)
if m:
return m.group(1)
Expand Down

0 comments on commit d0a9ccd

Please sign in to comment.