+# vim: set sts=4 sw=4 expandtab:
except User.DoesNotExist:
return None
+# vim: set sts=4 sw=4 expandtab:
+# vim: set sts=4 sw=4 expandtab:
class Admin:
pass
+# vim: set sts=4 sw=4 expandtab:
# Create your views here.
+# vim: set sts=4 sw=4 expandtab:
+# vim: set sts=4 sw=4 expandtab:
class Registration(models.Model):
person = models.ForeignKey(User, edit_inline=models.STACKED, num_in_admin=3)
event = models.ForeignKey(Event, core=True)
+# vim: set sts=4 sw=4 expandtab:
+# vim: set sts=4 sw=4 expandtab:
p.save()
except Exception:
print props
+# vim: set sts=4 sw=4 expandtab:
import notify
+# vim: set sts=4 sw=4 expandtab:
verbose_name = _("Influence")
verbose_name_plural = _("Influences")
+# vim: set sts=4 sw=4 expandtab:
notify([instance.character.player, 'lextalionis@evolution-events.nl'], 'influences/email/influence_changed.html', {'influence' : instance, 'created' : created})
dispatcher.connect(influence_saved, signals.post_save, Influence)
+# vim: set sts=4 sw=4 expandtab:
f = InfluenceForm(request=request, initial=initial)
if (f.is_valid()):
influence = f.save(commit=False)
- if (influence.character.player == request.user):
- influence.save()
- return HttpResponseRedirect(reverse('influences_influence_detail', args=[influence.id]))
- else:
- # TODO: Make this a bit more pretty. Perhaps throw an exception here and add some middleware to catch it?
- return HttpResponseForbidden("Forbidden -- Trying to submit influence for somebody else's character")
+ if (influence.character.player == request.user):
+ influence.save()
+ return HttpResponseRedirect(reverse('influences_influence_detail', args=[influence.id]))
+ else:
+ # TODO: Make this a bit more pretty. Perhaps throw an exception here and add some middleware to catch it?
+ return HttpResponseForbidden("Forbidden -- Trying to submit influence for somebody else's character")
# Only allow characters of the current user
f.fields['character']._set_queryset(chars)
@login_required
def influence_detail(*args, **kwargs):
return object_detail(*args, **kwargs)
+
+# vim: set sts=4 sw=4 expandtab:
if __name__ == "__main__":
execute_manager(settings)
+# vim: set sts=4 sw=4 expandtab:
)
AUTH_PROFILE_MODULE = 'base.UserProfile'
+# vim: set sts=4 sw=4 expandtab:
+# vim: set sts=4 sw=4 expandtab:
"""
return {'STATIC_URL_PREFIX': settings.STATIC_URL_PREFIX}
+# vim: set sts=4 sw=4 expandtab:
class ContextModelForm(BaseContextModelForm):
__metaclass__ = ModelFormMetaclass
-# vim:set sts=4 ts=4 sw=4 ai et:
+# vim: set sts=4 sw=4 expandtab:
except TypeError:
pass
return [value]
+# vim: set sts=4 sw=4 expandtab:
headers = headers_dict
)
msg.send()
+# vim: set sts=4 sw=4 expandtab:
+# vim: set sts=4 sw=4 expandtab:
(r'^static/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': os.path.join(settings.PROJECT_DIR, 'static')}),
)
+# vim: set sts=4 sw=4 expandtab: