Remove test_site
This commit is contained in:
parent
58e4b16a90
commit
304fa0e0f3
4 changed files with 0 additions and 24 deletions
|
@ -65,10 +65,6 @@ class UserForm(ModelForm):
|
||||||
|
|
||||||
|
|
||||||
class ProfileForm(ModelForm):
|
class ProfileForm(ModelForm):
|
||||||
test_site = forms.BooleanField(
|
|
||||||
label=_("Enable experimental features"), initial=False, required=False
|
|
||||||
)
|
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Profile
|
model = Profile
|
||||||
fields = [
|
fields = [
|
||||||
|
|
|
@ -414,21 +414,10 @@ def edit_profile(request):
|
||||||
form.save()
|
form.save()
|
||||||
revisions.set_user(request.user)
|
revisions.set_user(request.user)
|
||||||
revisions.set_comment(_("Updated on site"))
|
revisions.set_comment(_("Updated on site"))
|
||||||
|
|
||||||
perm = Permission.objects.get(
|
|
||||||
codename="test_site",
|
|
||||||
content_type=ContentType.objects.get_for_model(Profile),
|
|
||||||
)
|
|
||||||
if form.cleaned_data["test_site"]:
|
|
||||||
request.user.user_permissions.add(perm)
|
|
||||||
else:
|
|
||||||
request.user.user_permissions.remove(perm)
|
|
||||||
|
|
||||||
return HttpResponseRedirect(request.path)
|
return HttpResponseRedirect(request.path)
|
||||||
else:
|
else:
|
||||||
form_user = UserForm(instance=request.user)
|
form_user = UserForm(instance=request.user)
|
||||||
form = ProfileForm(instance=profile, user=request.user)
|
form = ProfileForm(instance=profile, user=request.user)
|
||||||
form.fields["test_site"].initial = request.user.has_perm("judge.test_site")
|
|
||||||
|
|
||||||
tzmap = settings.TIMEZONE_MAP
|
tzmap = settings.TIMEZONE_MAP
|
||||||
|
|
||||||
|
|
|
@ -697,7 +697,6 @@ ul.select2-selection__rendered {
|
||||||
#center-float {
|
#center-float {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
text-align: initial;
|
text-align: initial;
|
||||||
max-width: 450px;
|
|
||||||
width: 450px;
|
width: 450px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -127,14 +127,6 @@
|
||||||
<td><span class="fullwidth">{{ form.math_engine }}</span></td>
|
<td><span class="fullwidth">{{ form.math_engine }}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<tr>
|
|
||||||
<td colspan="2">
|
|
||||||
{{ form.test_site }}
|
|
||||||
<label for="id_test_site" style="float: unset" class="inline-header grayed">
|
|
||||||
{{- form.test_site.label -}}
|
|
||||||
</label>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
<a href="http://www.gravatar.com/" title="{{ _('Change your avatar') }}"
|
<a href="http://www.gravatar.com/" title="{{ _('Change your avatar') }}"
|
||||||
|
|
Loading…
Reference in a new issue