mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
SAS fixes
This commit is contained in:
@ -17,9 +17,11 @@ class Picture(SithFile):
|
||||
|
||||
@property
|
||||
def is_vertical(self):
|
||||
im = Image.open(BytesIO(self.file.read()))
|
||||
(w, h) = im.size
|
||||
return (w / h) < 1
|
||||
with open(settings.MEDIA_ROOT + self.file.name).encode('utf-8'), 'rb') as f:
|
||||
im = Image.open(BytesIO(f.read()))
|
||||
(w, h) = im.size
|
||||
return (w / h) < 1
|
||||
return False
|
||||
|
||||
def can_be_edited_by(self, user):
|
||||
return user.is_in_group(settings.SITH_SAS_ADMIN_GROUP_ID)
|
||||
|
@ -18,7 +18,7 @@
|
||||
<a href="{{ url('sas:album_edit', album_id=album.id) }}">{% trans %}Edit{% endtrans %}</a><br>
|
||||
<hr>
|
||||
<div>
|
||||
{% for a in album.children.filter(is_folder=True, is_moderated=True).all() %}
|
||||
{% for a in album.children.filter(is_folder=True, is_moderated=True).order_by('-id') %}
|
||||
<a href="{{ url("sas:album", album_id=a.id) }}" style="display: inline-block">
|
||||
<div class="album">
|
||||
<div>
|
||||
|
Reference in New Issue
Block a user