Skip to content

Commit

Permalink
修改了自定义关系的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
左正 committed May 20, 2020
1 parent 963e301 commit e837cc8
Show file tree
Hide file tree
Showing 5 changed files with 226 additions and 130 deletions.
144 changes: 89 additions & 55 deletions textMark/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions textMark/common/migrations/0003_merge_20200520_1445.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Generated by Django 3.0.5 on 2020-05-20 06:45

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('common', '0002_reltype'),
('common', '0002_auto_20200511_2155'),
]

operations = [
]
Binary file modified textMark/db.sqlite3
Binary file not shown.
7 changes: 3 additions & 4 deletions textMark/project/relation.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,14 @@ def addtype(request):
})

for reltype in types:

if info['name'] == reltype.name:
username = big_user.objects.get(id=uid)
if info['name'] == reltype['name']:
username = big_user.objects.get(id=uid).name
return JsonResponse({
'ret': 1,
'msg': f'关系名在项目中已经存在,添加者为{username}'
})

record = Entity.objects.create(name=info['name'],
record = RelType.objects.create(name=info['name'],
project_id=pid,
user_id=uid)

Expand Down
Loading

0 comments on commit e837cc8

Please sign in to comment.