Commit 1ec1ae39 by Dudás Ádám

school: don't create Person if it doesn't exist on removal from group

parent 687a5107
...@@ -227,7 +227,7 @@ def group_ajax_remove_member(request, gid): ...@@ -227,7 +227,7 @@ def group_ajax_remove_member(request, gid):
status = json.dumps({'status': 'Error'}) status = json.dumps({'status': 'Error'})
messages.error(request, _('Invalid NEPTUN code')) messages.error(request, _('Invalid NEPTUN code'))
return HttpResponse(status) return HttpResponse(status)
person, created = Person.objects.get_or_create(code=member) person = Person.objects.get(code=member)
group.members.remove(person) group.members.remove(person)
group.save() group.save()
return HttpResponse(json.dumps({ return HttpResponse(json.dumps({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment