mirror of
https://github.com/fergalmoran/dss.git
synced 2025-12-22 09:38:18 +00:00
Fixed radio buttons in user profile view
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.core.management.base import NoArgsCommand, CommandError
|
||||
from spa.models import UserProfile
|
||||
from core.utils.url import unique_slugify
|
||||
|
||||
class Command(NoArgsCommand):
|
||||
help = "Updates audio files with their durations"
|
||||
|
||||
def handle(user, *args, **options):
|
||||
try:
|
||||
candidates = User.objects.all()
|
||||
for user in candidates:
|
||||
try:
|
||||
profile = user.get_profile()
|
||||
except ObjectDoesNotExist, ce:
|
||||
print "Creating profile for %s" % user.get_username()
|
||||
UserProfile.objects.create(user=user)
|
||||
profile = user.get_profile()
|
||||
|
||||
if profile.slug is None or profile.slug == '':
|
||||
profile.slug = unique_slugify(profile, user.get_username())
|
||||
print "Slugified: %s" % profile.slug
|
||||
profile.save()
|
||||
|
||||
user.save()
|
||||
except Exception, ex:
|
||||
raise CommandError(ex.message)
|
||||
@@ -67,21 +67,14 @@ class UserProfile(BaseModel):
|
||||
Save Photo after ensuring it is not blank. Resize as needed.
|
||||
"""
|
||||
if self.slug is None or self.slug == '':
|
||||
self.slug = unique_slugify(self, self.get_username())
|
||||
self.slug = unique_slugify(self, self.user.get_username())
|
||||
print "Slugified: %s" % self.slug
|
||||
|
||||
"""
|
||||
Check if follower has been added
|
||||
"""
|
||||
l = self.get_dirty_fields()
|
||||
|
||||
return super(UserProfile, self).save(force_insert, force_update, using, update_fields)
|
||||
|
||||
def get_username(self):
|
||||
return self.user.username
|
||||
|
||||
username = property(get_username)
|
||||
|
||||
def get_email(self):
|
||||
return self.user.email
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
My Profile
|
||||
</a>
|
||||
</li>
|
||||
<li class="purple">
|
||||
<li >
|
||||
<a href="/me">
|
||||
<i class="menu-icon fa fa-cogs"></i>
|
||||
Settings
|
||||
|
||||
@@ -33,22 +33,27 @@
|
||||
value="<%= email %>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix control-group" id="div_avatar_image_select">
|
||||
<label class="control-label requiredField" for="avatar_image_select_0">Avatar Image
|
||||
<span class="asteriskField">*</span></label>
|
||||
|
||||
<div class="controls">
|
||||
<label class="radio">
|
||||
Use gravatar image.
|
||||
<input type="radio" id='avatar_gravatar' value='gravatar' name="avatar_type"/>
|
||||
<div class="control-group">
|
||||
<label class="control-label bolder blue">Avatar Image</label>
|
||||
|
||||
<div class="radio">
|
||||
<label>
|
||||
<input type="radio" id='avatar_gravatar' value='gravatar' name="avatar_type"
|
||||
class="ace"/>
|
||||
<span class="lbl"> Use gravatar image.</span>
|
||||
</label>
|
||||
<label class="radio">
|
||||
Use Twitter/Facebook image.
|
||||
<input type="radio" id='avatar_social' value='social' name="avatar_type"/>
|
||||
</div>
|
||||
<div class="radio">
|
||||
<label>
|
||||
<input type="radio" id='avatar_social' value='social' name="avatar_type" class="ace"/>
|
||||
<span class="lbl"> Use Twitter/Facebook image.</span>
|
||||
</label>
|
||||
<label class="radio">
|
||||
Use custom image.
|
||||
<input type="radio" id='avatar_custom' value='custom' name="avatar_type"/>
|
||||
</div>
|
||||
<div class="radio">
|
||||
<label>
|
||||
<input type="radio" id='avatar_custom' value='custom' name="avatar_type" class="ace"/>
|
||||
<span class="lbl"> Use custom image.</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user