Commit 4eb40732 by Dányi Bence

school: group creation with fake users allowed

parent eb66a23d
...@@ -153,11 +153,7 @@ def group_new(request): ...@@ -153,11 +153,7 @@ def group_new(request):
if re.match('^[a-zA-Z][a-zA-Z0-9]{5}$', member) == None: if re.match('^[a-zA-Z][a-zA-Z0-9]{5}$', member) == None:
messages.error(request, _('Invalid NEPTUN code found.')) messages.error(request, _('Invalid NEPTUN code found.'))
return redirect('/') return redirect('/')
try: person = Person.objects.get_or_create(code=member)
user = User.objects.get(username=member)
person = user.person_set.all()[0]
except User.DoesNotExist:
pass
members.append(person) members.append(person)
owner = request.user.person_set.all()[0] owner = request.user.person_set.all()[0]
group = Group() group = Group()
......
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