Skip to content

Commit

Permalink
hotfix os import
Browse files Browse the repository at this point in the history
  • Loading branch information
freeziyou committed Feb 27, 2024
1 parent b550974 commit 1654af7
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions server/tasks/lark/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,13 @@
from urllib.parse import urlparse

from celery_app import app, celery
from model.schema import (
ChatGroup,
CodeApplication,
CodeUser,
IMUser,
Repo,
Team,
TeamMember,
db,
)
from model.schema import ChatGroup, CodeApplication, Repo, Team, db
from model.team import get_code_users_by_openid
from sqlalchemy.orm import aliased
from tasks.lark.issue import replace_im_name_to_github_name
from tasks.lark.manage import send_manage_fail_message
from utils.github.repo import GitHubAppRepo
from utils.lark.chat_manual import ChatManual, ChatView
from utils.lark.chat_tip_failed import ChatTipFailed
from utils.lark.issue_card import IssueCard
from utils.lark.post_message import post_content_to_markdown

from .base import (
Expand Down Expand Up @@ -295,9 +285,7 @@ def create_issue(
if openid not in code_users:
host = os.environ.get("DOMAIN")

import tasks

return tasks.send_manage_fail_message(
return send_manage_fail_message(
f"[请点击绑定 GitHub 账号后重试]({host}/api/github/oauth)",
app_id,
message_id,
Expand Down Expand Up @@ -455,12 +443,10 @@ def sync_issue(
# 这里连三个表查询,所以一次性都查出来
code_users = get_code_users_by_openid([openid])

import tasks

if openid not in code_users:
host = os.environ.get("DOMAIN")

return tasks.send_manage_fail_message(
return send_manage_fail_message(
f"[请点击绑定 GitHub 账号后重试]({host}/api/github/oauth)",
app_id,
message_id,
Expand Down

0 comments on commit 1654af7

Please sign in to comment.