Skip to content
Snippets Groups Projects
Commit cb4129f2 authored by Andreas Ellewsen's avatar Andreas Ellewsen
Browse files

Merge branch 'GREG-186-identifier-source' into 'master'

Use default source for manual identities

See merge request !261
parents b4878b99 9bc5f84a
No related branches found
No related tags found
1 merge request!261Use default source for manual identities
Pipeline #112520 passed
...@@ -330,3 +330,7 @@ NOTIFIER_LIMIT = 7 ...@@ -330,3 +330,7 @@ NOTIFIER_LIMIT = 7
# Default schedule for the task notifying about ending roles. Used by the management # Default schedule for the task notifying about ending roles. Used by the management
# command that triggers the task. # command that triggers the task.
NOTIFIER_SCHEDULE_TYPE = "W" NOTIFIER_SCHEDULE_TYPE = "W"
# Source used when creating identities that do not have a clear source like
# feide/id-porten
DEFAULT_IDENTITY_SOURCE = "greg"
import datetime import datetime
from django.conf import settings
from django.utils.timezone import now from django.utils.timezone import now
from rest_framework import serializers from rest_framework import serializers
from rest_framework.exceptions import ValidationError from rest_framework.exceptions import ValidationError
...@@ -156,6 +157,7 @@ def create_identity_or_update( ...@@ -156,6 +157,7 @@ def create_identity_or_update(
Identity.objects.create( Identity.objects.create(
person=person, person=person,
type=identity_type, type=identity_type,
source=settings.DEFAULT_IDENTITY_SOURCE,
value=value, value=value,
) )
else: else:
......
import datetime import datetime
from django.conf import settings
from django.db import transaction from django.db import transaction
from django.utils import timezone from django.utils import timezone
from rest_framework import serializers from rest_framework import serializers
...@@ -27,7 +28,7 @@ class InviteGuestSerializer(serializers.ModelSerializer): ...@@ -27,7 +28,7 @@ class InviteGuestSerializer(serializers.ModelSerializer):
person=person, person=person,
type=Identity.IdentityType.PRIVATE_EMAIL, type=Identity.IdentityType.PRIVATE_EMAIL,
value=email, value=email,
source="greg", source=settings.DEFAULT_IDENTITY_SOURCE,
) )
role_data["person"] = person role_data["person"] = person
role_data["sponsor"] = user.sponsor role_data["sponsor"] = user.sponsor
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment