- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
def profile_edit(request, template_name='profile/subdiler/profile_edit.html'):
profile = request.profile
if request.method == "POST":
form = DilerProfileForm(request.POST, request.FILES, instance=profile)
if form.is_valid():
profile = form.save(commit=False)
try:
profile.avatar = profile.avatar[0]
except:
pass
try:
profile.sign = profile.sign[0]
except:
pass
profile.city = form.city
profile.save()