Skip to content

Commit

Permalink
feat(proposals): Remove remoting_policy
Browse files Browse the repository at this point in the history
  • Loading branch information
setmao committed Feb 27, 2022
1 parent 51aa33b commit bfe7a52
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 47 deletions.
11 changes: 0 additions & 11 deletions src/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,17 +204,6 @@ class EventInfo(models.Model):
auto_now=True,
)

REMOTE_POLICY_CHOICES = (
(True, _('Yes')),
(False, _('No'))
)

remoting_policy = models.BooleanField(
verbose_name=_('remoting policy'),
default=False,
choices=REMOTE_POLICY_CHOICES
)

PERFER_TIME_CHOICES = (
('DAY_ONE_MORNING', _('Day 1 morning')),
('DAY_ONE_AFTERNOON', _('Day 1 afternoon')),
Expand Down
11 changes: 1 addition & 10 deletions src/events/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,23 +103,14 @@ def get_speakers(self, obj):
request = self.context.get('request')
return format_speakers_data(request, [obj.host])

def to_representation(self, obj):
"""
Assign the value of `SponsoredEvent.remoting_policy` as `is_remote`
"""
representation = super().to_representation(obj)
is_remote = representation.pop('remoting_policy')
representation['is_remote'] = is_remote
return representation

class Meta:
model = SponsoredEvent
fields = [
"id", "title", "category", "language", "python_level",
"recording_policy", "abstract", "detailed_description",
"slide_link", "slido_embed_link", "hackmd_embed_link",
"speakers", "location", "begin_time", "end_time",
"remoting_policy", "event_type", 'youtube_id',
"event_type", 'youtube_id',
]


Expand Down
2 changes: 0 additions & 2 deletions src/proposals/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class ProposalAdmin(admin.ModelAdmin):
'duration',
'language',
'python_level',
'remoting_policy',
'accepted',
]
list_filter = [
Expand All @@ -44,7 +43,6 @@ class TalkProposalAdmin(ExportMixin, ProposalAdmin):
'duration',
'language',
'python_level',
'remoting_policy',
'first_time_speaker',
'accepted',
]
Expand Down
9 changes: 0 additions & 9 deletions src/proposals/forms/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ class Meta:
"target='_blank' rel='noopener'>Markdown</a>. "
"This is NOT made public and for REVIEW ONLY.</p>"
),
'remoting_policy': _(
"Whether you agree to deliver the talk remotely if the epidemic "
"(coronavirus) is still raging this August?"
),
'live_stream_policy': _(
"If you disagree to authorize PyCon Taiwan to record video, "
"whether you agree to let PyCon Taiwan live stream your presentation "
Expand Down Expand Up @@ -233,11 +229,6 @@ class Meta:
"target='_blank' rel='noopener'>Markdown</a>. "
"This is NOT made public and for REVIEW ONLY."
),
'remoting_policy': _(
"Whether you agree to deliver the tutorial remotely if the epidemic "
"(coronavirus) is still raging this August?"

),
'live_stream_policy': _(
"If you disagree to authorize PyCon Taiwan to record video, "
"whether you agree to let PyCon Taiwan live stream your presentation "
Expand Down
4 changes: 0 additions & 4 deletions src/proposals/forms/proposals.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class Meta(TalkProposalMixin.Meta):
'python_level',
'recording_policy',
'live_stream_policy',
'remoting_policy',
'first_time_speaker',
'referring_policy',
'prefer_time',
Expand Down Expand Up @@ -73,7 +72,6 @@ class Meta(TutorialProposalMixin.Meta):
'python_level',
'recording_policy',
'live_stream_policy',
'remoting_policy',
'prefer_time',
'living_in_taiwan',
'pre_recorded_policy',
Expand Down Expand Up @@ -115,7 +113,6 @@ class Meta(TalkProposalMixin.Meta):
'supplementary',
'recording_policy',
'live_stream_policy',
'remoting_policy',
'first_time_speaker',
'slide_link',
'referring_policy',
Expand Down Expand Up @@ -148,7 +145,6 @@ class Meta(TutorialProposalMixin.Meta):
'supplementary',
'recording_policy',
'live_stream_policy',
'remoting_policy',
'slide_link',
'prefer_time',
'living_in_taiwan',
Expand Down
2 changes: 1 addition & 1 deletion src/proposals/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ class Meta:
'stage_1_minus_0_count', 'stage_1_minus_1_count',
'stage_2_plus_1_count', 'stage_2_plus_0_count',
'stage_2_minus_0_count', 'stage_2_minus_1_count',
'remoting_policy', 'first_time_speaker', 'referring_policy'
'first_time_speaker', 'referring_policy'
]
export_order = fields
10 changes: 4 additions & 6 deletions src/proposals/tests/forms/test_proposal.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def talk_proposal_data():
'recording_policy': True,
'live_stream_policy': True,
'referring_policy': True,
'remoting_policy': True,
'first_time_speaker': True,
}

Expand All @@ -28,7 +27,7 @@ def test_talk_proposal_create_form():
form = TalkProposalCreateForm()
assert list(form.fields) == [
'title', 'category', 'duration', 'language', 'python_level', 'recording_policy',
'live_stream_policy', 'remoting_policy', 'first_time_speaker', 'referring_policy',
'live_stream_policy', 'first_time_speaker', 'referring_policy',
]


Expand Down Expand Up @@ -69,15 +68,14 @@ def tutorial_proposal_data():
'python_level': 'INTERMEDIATE',
'recording_policy': True,
'live_stream_policy': True,
'remoting_policy': True,
}


def test_tutorial_proposal_create_form():
form = TutorialProposalCreateForm()
assert list(form.fields) == [
'title', 'category', 'duration', 'language',
'python_level', 'recording_policy', 'live_stream_policy', 'remoting_policy',
'python_level', 'recording_policy', 'live_stream_policy',
]


Expand Down Expand Up @@ -118,7 +116,7 @@ def test_talk_proposal_update_form():
assert list(form.fields) == [
'title', 'category', 'duration', 'language', 'abstract', 'python_level',
'objective', 'detailed_description', 'outline', 'supplementary',
'recording_policy', 'live_stream_policy', 'remoting_policy', 'first_time_speaker',
'recording_policy', 'live_stream_policy', 'first_time_speaker',
'slide_link', 'referring_policy',
]

Expand All @@ -128,7 +126,7 @@ def test_tutorial_proposal_update_form():
assert list(form.fields) == [
'title', 'category', 'duration', 'language', 'abstract', 'python_level',
'objective', 'detailed_description', 'outline', 'supplementary',
'recording_policy', 'live_stream_policy', 'remoting_policy', 'slide_link',
'recording_policy', 'live_stream_policy', 'slide_link',
]


Expand Down
2 changes: 0 additions & 2 deletions src/proposals/tests/views/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ def test_talk_proposal_create_post(agreed_user, agreed_user_client):
'recording_policy': True,
'live_stream_policy': True,
'referring_policy': False,
'remoting_policy': True,
'first_time_speaker': True,
}, follow=True)

Expand Down Expand Up @@ -125,7 +124,6 @@ def test_tutorial_proposal_create_post(agreed_user, agreed_user_client):
'python_level': 'INTERMEDIATE',
'recording_policy': True,
'live_stream_policy': True,
'remoting_policy': True,
}, follow=True)

proposal = TutorialProposal.objects.get(
Expand Down
2 changes: 0 additions & 2 deletions src/proposals/tests/views/test_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ def test_talk_proposal_edit_post(agreed_user_client, talk_proposal):
'recording_policy': True,
'live_stream_policy': True,
'referring_policy': False,
'remoting_policy': True,
'first_time_speaker': True,
'abstract': (
"In the modern world, programmer’s time is more expensive than "
Expand Down Expand Up @@ -223,7 +222,6 @@ def test_tutorial_proposal_edit_post(agreed_user_client, tutorial_proposal):
'python_level': 'INTERMEDIATE',
'recording_policy': True,
'live_stream_policy': True,
'remoting_policy': True,
'abstract': (
"In the modern world, programmer’s time is more expensive than "
"computer’s time. Better maintainability saves more. To improve "
Expand Down

0 comments on commit bfe7a52

Please sign in to comment.