Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 304
Pending invitations shown on channel home page#258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
d964d537029033a0839d6e99ecb823d1d8c5b7c0882a5a807bd4fb2995b73ff3cedb2a074063dc532260b91dd9a36bff05e28668b4310fa92c47c67fc10a84File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -22,6 +22,9 @@ | ||
| from rest_framework.authtoken.models import Token | ||
| from le_utils.constants import content_kinds,file_formats, format_presets, licenses, exercises | ||
| EDIT_ACCESS = "edit" | ||
This comment was marked as spam.Sorry, something went wrong. Uh oh!There was an error while loading. Please reload this page. | ||
| VIEW_ACCESS = "view" | ||
| DEFAULT_USER_PREFERENCES = json.dumps({ | ||
| 'license': licenses.CC_BY, | ||
| 'language': None, | ||
| @@ -611,7 +614,7 @@ class Invitation(models.Model): | ||
| """ Invitation to edit channel """ | ||
| id = UUIDField(primary_key=True, default=uuid.uuid4) | ||
| invited = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.SET_NULL, null=True, related_name='sent_to') | ||
| share_mode = models.CharField(max_length=50, default='edit') | ||
| share_mode = models.CharField(max_length=50, default=EDIT_ACCESS) | ||
| email = models.EmailField(max_length=100, null=True) | ||
| sender = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.SET_NULL, related_name='sent_by', null=True) | ||
| channel = models.ForeignKey('Channel', on_delete=models.SET_NULL, null=True, related_name='pending_editors') | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -620,6 +620,12 @@ class Meta: | ||
| fields = ('email', 'first_name', 'last_name', 'id') | ||
| class InvitationSerializer(BulkSerializerMixin, serializers.ModelSerializer): | ||
| channel_name = serializers.SerializerMethodField('retrieve_channel_name') | ||
This comment was marked as spam.Sorry, something went wrong. Uh oh!There was an error while loading. Please reload this page. | ||
| sender = UserSerializer(read_only=True) | ||
| def retrieve_channel_name(self, invitation): | ||
| return invitation.channel.name | ||
| class Meta: | ||
| model = Invitation | ||
| fields = ('id', 'invited', 'email', 'sender', 'channel', 'first_name', 'last_name', 'share_mode') | ||
| fields = ('id', 'invited', 'email', 'sender', 'channel', 'first_name', 'last_name', 'share_mode', 'channel_name') | ||
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.