ResearchComputing / RCAMP

Research Computing Account Management Portal
MIT License
0 stars 0 forks source link

Existing accounts cause 500 #323

Open zebulasampedro opened 6 years ago

zebulasampedro commented 6 years ago
Traceback (most recent call last):
...
  File "/opt/rcamp/lib/python2.7/site-packages/django/views/generic/edit.py", line 215, in post
    return self.form_valid(form)
  File "./accounts/views.py", line 109, in form_valid
    account_request = AccountRequest.objects.create(**account_request_data)
...
  File "./accounts/models.py", line 111, in save
    role=self.role
  File "./accounts/models.py", line 260, in create_user_from_request
    user = self.create(**user_fields)
  File "./accounts/models.py", line 212, in create
    obj.save(force_insert=True,using=self.db,organization=org)
  File "./accounts/models.py", line 353, in save
    super(RcLdapUser,self).save(*args,**kwargs)
  File "./accounts/models.py", line 194, in save
    super(LdapUser,self).save(*args,**kwargs)
...
ALREADY_EXISTS: {'desc': 'Already exists'}
zebulasampedro commented 6 years ago

The request logic seems to protect against this, and I can't reproduce it under test, but it very clearly happened. My suspicion is that another error broke normal execution flow and resulted in this occurrence, given that we were observing other request problems around the same time.

I'm going to bump this from the next release for now, but keep it open and continue monitoring. In the future, this is the kind of problem that will be mitigated by #327.