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):
|
||||
test_site = forms.BooleanField(
|
||||
label=_("Enable experimental features"), initial=False, required=False
|
||||
)
|
||||
|
||||
class Meta:
|
||||
model = Profile
|
||||
fields = [
|
||||
|
|
|
@ -414,21 +414,10 @@ def edit_profile(request):
|
|||
form.save()
|
||||
revisions.set_user(request.user)
|
||||
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)
|
||||
else:
|
||||
form_user = UserForm(instance=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
|
||||
|
||||
|
|
|
@ -697,7 +697,6 @@ ul.select2-selection__rendered {
|
|||
#center-float {
|
||||
display: inline-block;
|
||||
text-align: initial;
|
||||
max-width: 450px;
|
||||
width: 450px;
|
||||
}
|
||||
|
||||
|
|
|
@ -127,14 +127,6 @@
|
|||
<td><span class="fullwidth">{{ form.math_engine }}</span></td>
|
||||
</tr>
|
||||
{% 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>
|
||||
<td colspan="2">
|
||||
<a href="http://www.gravatar.com/" title="{{ _('Change your avatar') }}"
|
||||
|
|
Loading…
Reference in a new issue