Cosmetic fixes on references services and user form.

remotes/origin/enhancement/email-actions
Andrey Antukh 2014-06-05 12:52:47 +02:00
parent 9c5c9bc094
commit 38cd770c9b
2 changed files with 9 additions and 7 deletions

View File

@ -1,9 +1,11 @@
from .models import Reference from django.db.models.loading import get_model
def get_instance_by_ref(project_id, obj_ref): def get_instance_by_ref(project_id, obj_ref):
model_cls = get_model("references", "Reference")
try: try:
instance = Reference.objects.get(project_id=project_id, ref=obj_ref) instance = model_cls.objects.get(project_id=project_id, ref=obj_ref)
except Reference.DoesNotExist: except model_cls.DoesNotExist:
instance = None instance = None
return instance return instance

View File

@ -15,10 +15,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from django import forms from django import forms
from django.contrib.auth.forms import ( from django.contrib.auth.forms import UserCreationForm as DjangoUserCreationForm
UserCreationForm as DjangoUserCreationForm, from django.contrib.auth.forms import UserChangeForm as DjangoUserChangeForm
UserChangeForm as DjangoUserChangeForm
)
from .models import User from .models import User