stxnext-csr / volontulo

Web portal for collaboration of community volunteers with organizations and institutions.
MIT License
14 stars 24 forks source link

Signal receiver that creates UserProfile when User created (fixes #581) #582

Open JarUrb opened 7 years ago

JarUrb commented 7 years ago

Bug id: https://github.com/stxnext-csr/volontulo/issues/581

Reference person: @JarUrb

Description:

When user is created using manage.py createsuperuser, user's profile isn't created. It can lead to internal server errors (HTTP 500).

In commit 2bdb371437d121d73739b981f39b1906c6377606 I added test to show that case. That test would fail without changes in commit bb924b50fffe51093e1ae87cfbf84894539d0797. I also had to fix other tests in commit 1e5d85ced5ccf056874d85f98e961fe4f7cd3f73.

I know that some people don't like signals, but without this change we would have to deal with inconsistent data (i.e. user without corresponding UserProfile) or solve the problem another way (e.g. by subclassing Django's User model and overriding save() method) or forbid using manage.py createsuperuser entirely.

magul commented 7 years ago

@JarUrb Cześć, po pierwsze miło Ciebie widzieć i super, że ktoś się angażuje!

Druga sprawa jest taka, że ten akurat PR nie przechodzi testów na Travisie (https://travis-ci.org/stxnext-csr/volontulo/builds/174596430) i w tym sensie nikt tego nie zmerdżuje.

No i trzecia kwestia, turaj raczej to już w ogóle nie pracuje, całą zaangażowaną ekipą przenosimy się do @CodeForPoznan, więc jeżeli będziesz chciał nad tym projektem popracować w kilka osób, to pewnie dobrze byłoby, gdybyś tam wystawiał PR i zgłaszał błędy.

Mamy tam jeszcze kilka rzeczy do dociągnięcia (chociażby skonfigurować poprawnie gittera i travisa), ale to typowe choroby wieku dziecięcego i pewnie niedługo ruszymy dosyć sprawnie.

Daj znać co o tym myślisz.

pzdr

codecov-io commented 7 years ago

Current coverage is 91.37% (diff: 98.41%)

Merging #582 into master will increase coverage by 0.10%

@@             master       #582   diff @@
==========================================
  Files            53         56     +3   
  Lines          2073       2099    +26   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           1892       1918    +26   
  Misses          181        181          
  Partials          0          0          

Powered by Codecov. Last update 5a7a192...eed92e5

JarUrb commented 7 years ago

Cześć @magul.

  1. Zobaczymy, na jak długo starczy mi zapału.
  2. Już przechodzi (dzięki poprawkom w 7b2b09854c2434abd6b334042baa470ef07fa546).
  3. Dziwi mnie to trochę, bo widzę, że jesteś członkiem organizacji stxnext-csr, więc chyba prace mogłyby być prowadzone w dotychczasowym repo. Ale OK, skoro taką podjęliście decyzję, to będę zgłaszał pull requesty do CodeForPoznań. Oto prośba o włączenie tej samej gałęzi: https://github.com/CodeForPoznan/volontulo/pull/497.

Chciałem się zająć którymś z wcześniej zgłoszonych błędów, ale nie miałem zbyt wiele czasu, żeby się wgryźć w kod i połapać, o co w tym wszystkim chodzi. Będę jednak próbował porobić coś w projekcie.

Pozdrawiam.